SlideShare a Scribd company logo
Differences Haskell /
Frege
Towards making Frege a better
Haskell dialect/subset Ingo Wechsung
IT Consultant, contexo GmbH
Reutlingen, Germany
@iwechsu
State and Vision
GHC
Haskell
2010
Frege
GHC
Haskell
2010
Frege
Purpose of this Presentation
● To give a comprehensive overview about
really existing differences and what can be
done about them.
● Community to
○ discuss if and how to deal with them
○ create corresponding GitHub issues, if applicable
○ actually work on the issues
Preliminary notes
In the following slides, “Standard” refers to the Haskell
2010 Language Report https://haskell.
org/definition/haskell2010.pdf
Suggestions and estimations of importances and efforts
are my subjective opinions (well founded ones, of
course☺).
Haskell Compatibility Mode?
There are some Frege features that cannot get
abandoned without making Frege
● less practical for use on the JVM
● less good than it is
When otherwise unresolvable conflicts with
the Standard arise, should we have a “haskell
compatibility mode” (abbrev. HCM)?
Variable names
● Frege: allows apostrophes only at the end,
no underscores at start
● Standard: “An identifier consists of a letter followed
by zero or more letters, digits, underscores, and single
quotes.” (2.4, pg. 9)
● Effort: low (simple fix in lexical analyzer)
● Importance: low
● Suggestions: implement
Operator constructors (1)
● Frege: operator constructors are not
supported
● Standard: “An operator symbol starting with
a colon is a constructor.” (2.4, pg. 10)
data Complex = Double :+ Double
● Effort: medium (parsing)
● Importance: high
● Suggestion: implement
Operator constructors (2)
Note that GHC extension -XTypeOperators in addition
allows infix type constructors: Int :& Int :| Double :&
Double
Implementing this would entail a whole range of changes.
The critical point is that types could only get parsed once
the fixity of the operators is known. Currently, type
parsing is already complete when the parser is done.
Octal integer literals
● Frege: Java literal syntax, e.g. 032 == 26
● Standard: octal literals 0o32 (2.5, pg. 11)
● Effort: low, rewrite literal in lexer
● Importance: low
● Suggestion: implement. Interpret 032 as 32
in HCM. Or just get rid of octal literals
entirely.
String and Char literals
● Frege: certain escape sequences and gaps
in strings (multi line strings) won’t work
● Standard: 2.6, page 11f
● Effort: medium, bikeshedding
● Importance: low
● Suggestion: Need not be done all at once.
The gaps feature would be worth having.
Meaning of String Literals
● Frege: string literals mean (Java) strings
● Standard: “String literals are actually abbreviations
for lists of characters” (2.6, pg. 12)
● Effort: medium
● Importance: high
● Suggestions: overload string literals so that
list functions work, follow standard in HCM.
Layout (1)
● Frege: no insertion of {}
● Standard: “If the indentation of the non-brace
lexeme immediately following a where, let, do or of is
less than or equal to the current indentation level,
then … {} is inserted …” (2.7, pg. 12)
● Effort: medium
● Importance: medium
● Suggestion: adapt
Layout (2)
● Frege: no “syntactic” insertion of closing
brace except before in
● Standard: “... if an illegal lexeme is encountered at
a point where a close brace would be legal, a close
brace is inserted.” (2.7, pg. 12)
● Effort: high (layout is lexical only)
● Importance: low
● Suggestions: try to cover some cases
Overloaded Integer literals
● Frege: numeric literals are not overloaded
● Standard: “An integer literal represents the
application of the function fromInteger to the
appropriate value of type Integer” (3.2, page 17)
● Effort: low, possibly breaks existing code
● Importance: medium
● Suggestions: slightly in favor, but should be
done together with floating point literals
Overloaded Floating Point Literals
● Standard: “The floating point literal f is equivalent
to fromRational (n Ratio.% d ), where
fromRational is a method in class Fractional and
Ratio.% constructs a rational from two integers, as
defined in the Ratio library. The integers n and d are
chosen so that n/d = f.” (3.2, pg. 17)
● Effort: high, Fractional and Ratio don’t exist yet
● Importance: high
● Suggestions: first implement needed classes and types.
Overloading itself can be done later, or just in HCM.
Lambda abstractions
● Frege: only single pattern allowed
● Standard: “Lambda abstractions are written p1
. . .
pn
-> e, where the pi
are patterns.” (3.3, pg. 18)
● Effort: high
● Importance: medium
● Suggestion: would break existing programs
that have smth. like: x:xs -> x
Field Labels as Selectors
● Frege: field labels (selectors) not top level
● Standard: “Selectors are top level bindings ...”
(3.15.1, pg. 26)
● Effort: depending on solution
● Importance: low
● Suggestion: implement in HCM only
Construction using Field Labels
● Frege: all field labels must be mentioned
● Standard: Fields not mentioned are initialized to ⊥.
(3.15.2, pg. 26)
● Effort: low
● Importance: low
● Suggestions: HCM only
Updates Using Field Labels
● Frege: slightly different syntax
● Standard: “aexp<qcon>
{ fbind1
, . . . , fbind n
}”
(3.15.3, pg. 27)
● Effort: low
● Importance: medium
● Suggestions: implement, retire Frege dot-
syntax
Pattern syntax
● Frege: uses expression syntax
● Standard: defines extra syntax for patterns
(3.17.1, page 28), makes @ and ~ reserved
symbols
● Effort: surprisingly high, breaks Frege code
● Importance: high
● Suggestion: ???
Negative Patterns
● Frege: not supported
● Standard: allows them with numeric literals
(3.17.1, page 28)
● Effort: medium
● Importance: medium
● Suggestions: implement
Irrefutable pattern
● Frege: not supported
● Standard: ~apat (3.17.1, page 28)
● Effort, Importance, Suggestions: see
“Pattern syntax”
Context in Data Declaration
● Frege: not allowed
● Standard: data [context =>] simpletype [= constrs]
(4.2.1, page 40)
● Effort: medium
● Importance: very low
● Suggestion: don’t implement, as it is
considered bad practice anyway
“deriving” clause in data defs
● Frege: has separate derive definition
● Standard: optional deriving clause on data
declarations (4.2.1, page 40)
● Effort: medium
● Importance: high, though GHC now also has
separate deriving declaration
● Suggestion: implement
Datatype renamings
● Frege: can be achieved with data
● Standard: uses newtype for renaming, data
has slightly different semantics. (4.2.3,
page 43)
● Effort: low/medium
● Importance: high/low
● Suggestion: support syntax, ignore corner
data case except in HCM
Context in Class/Instance
Declarations
● Frege: class name first
● Standard: context first (4.3.1, 4.3.2, pages
44ff)
● Effort: small
● Importance: high
● Suggestion: this stupid error on my side
should long have been fixed. Requires
adaption of most existing code, though.
Numeric Type Defaulting
Frege: not done
Standard: specifies default declaration
Effort: medium
Importance: ?
Suggestion: In a first step, just the syntax
could be implemented.
Fixity Declarations
● Frege: top level only
● Standard: has them as nested declarations, they can
appear in class declarations and let/where (4.4.2,
page 50)
● Effort: medium
● Importance: low
● Suggestions: follow standard
Mutually Recursive Modules
● Frege modules form a directed acyclic
graph
● Standard: “allowed to be mutually recursive” (5,
page 62)
● Effort: quite high
● Importance: low?
● Suggestions: don’t touch for now.
Optional Module Header
● Frege: module header is mandatory
● Standard: “An abbreviated form of module,
consisting only of the module body, is permitted.”
(5.1, page 62)
● Importance: low
● Effort: low
● Suggestion: implement
Modules - Export Lists
● tell what can be imported by other modules
● in Frege, we have private/public/protected
● Effort: medium .. very high
● Importance: medium
● Suggestions: do this in multiple steps
a. parse them, but ignore them (everything public)
b. default to “private” when present
c. retire private/public/protected
Import Declarations
● Frege
○ doesn’t allow qualified names as module aliases
○ instead, all module names are mapped to
namespace names
○ doesn’t have the (..) syntax for “all sub-items”
○ doesn’t have qualified
● Standard: 5.3, pages 64ff.
● Suggestion: handle diffs in HCM
Comparison Haskell/Frege Imports
import A.B -- all
import A.B() -- none
import A.B(T(C))
import A.B(T(..))
import A.B(T)
import A.B(T())
import qualified A
import qualified A()
import a.B -- all
import a.B() -- none
import a.B(T(C))
import a.B(T)
import a.B(T())
import a.B(T())
import A()
-- makes no sense
Qualified Names and Module Names
● Frege uses module names only for imports.
Thereafter, only the namespace name can
be used for qualification.
● Standard: modid.name (5.5.1, page 67)
● Importance: low
● Effort: impossible
● Suggestion: leave as is
Standard Type Boolean
● Frege uses primitive JVM type:
data Bool = pure native boolean
Keyword literals true and false are provided.
● Standard: “The boolean type Bool is an
enumeration.”
data Bool = False | True
● Importance: high
● Suggestion: cheat in the compiler
Characters
● Frege Char are UTF-16 values
● Standard: “The character type Char is an
enumeration whose values represent Unicode
characters” (6.1.2, page 73)
● Importance: low (?)
● Effort: hack JVM
● Suggestions: hope for JVM evolution
Strings
● Frege uses native java.lang.String type
● Standard: “A string is a list of characters” (6.1.2,
page 73)
● Importance: medium (beginners!)
● Effort: medium
● Suggestion: overload string literals
IOERR
● Frege doesn’t have it
● Standard: “IOError is an abstract type representing
errors raised by I/O operations.” (6.1.7, page 75)
● Importance: low
● Effort: probably low
● Suggestions: can we get away with
type IOERR = IOException
class Read, read
● not implemented
● Standard: “The Read ... [class is] used to convert
values ... from strings.” (6.3.3, page 78)
● Importance: medium
● Effort: medium
● Suggestions: Implement at least for basic
types.
Numbers
● Frege doesn’t have all the type classes, no
rationals and complex numbers at this time.
● Standard: prescribes a complex web of
numeric type classes (6.4, page 81ff)
● Importance: medium
● Effort: high
● Suggestion: needs care. Or a
mathematically sound alternative.
IO Exception Handling
● Frege uses Java Exceptions
● Standard: IO Exception Handling (7.3, page
90)
● Importance: none
● Effort: N/A
● Suggestion: don’t change
Foreign Function Interface
● Frege has its own Native Interface
● Standard: (8, page 91ff)
● Importance: none
● Effort: small
● Suggestion: Haskell sources using standard
FFI (i.e. calls into C) are not portable
support the foreign import/export syntax
though?
Haskell 2010 Libraries
● missing, should be done:
○ Data.Array, Data.Complex, Data.Int, Data.Ix, Data.
Ratio, Data.Word, Numeric, System.Environment,
System.Exit
● present (may be incomplete) :
○ Data.Bits, Data.Char, Data.List, Data.Maybe
● not done:
○ Foreign, Foreign.*, System.IO, System.IO.Error
● obsolete: Control.Monad
Conclusion
● we have a long way to go
● much work to be done
● much can be done to enhance “Haskellnes”
Background, Pointers & Links
● Haskell 2010 Language Report
● GHC Language System
● Frege Wiki
○ https://github.com/Frege/frege/wiki/GHC-
Language-Options-vs.-Frege
○ https://github.com/Frege/frege/wiki/Differences-
between-Frege-and-Haskell
I need
a
break!

More Related Content

PDF
FregeDay: Design and Implementation of the language (Ingo Wechsung)
PDF
New c sharp4_features_part_i
PPT
C++ to java
PPTX
C++vs java
PPTX
C++ vs C#
PPTX
phases of compiler
PDF
New c sharp4_features_part_iv
ODP
2nd presantation
FregeDay: Design and Implementation of the language (Ingo Wechsung)
New c sharp4_features_part_i
C++ to java
C++vs java
C++ vs C#
phases of compiler
New c sharp4_features_part_iv
2nd presantation

What's hot (20)

ODP
New c sharp4_features_part_iii
PPT
Introduction Functional Programming - Tech Hangout #11 - 2013.01.16
PPT
Introductory func prog
PDF
New c sharp4_features_part_v
PPTX
Introduction to C programming
PPTX
Trans coder
PDF
07 control+structures
PPTX
C-Sharp 6.0 ver2
PPTX
Programming Paradigm & Languages
PPTX
Academy PRO: React JS. Typescript
PPT
F# and the DLR
ODP
New c sharp3_features_(linq)_part_iv
PPT
First draft programming c++
PPTX
Implementation of lexical analyser
PPTX
Functional programming in TypeScript
PPTX
C#unit4
PPTX
difference between c c++ c#
PPTX
C language
PPTX
CSharp Presentation
New c sharp4_features_part_iii
Introduction Functional Programming - Tech Hangout #11 - 2013.01.16
Introductory func prog
New c sharp4_features_part_v
Introduction to C programming
Trans coder
07 control+structures
C-Sharp 6.0 ver2
Programming Paradigm & Languages
Academy PRO: React JS. Typescript
F# and the DLR
New c sharp3_features_(linq)_part_iv
First draft programming c++
Implementation of lexical analyser
Functional programming in TypeScript
C#unit4
difference between c c++ c#
C language
CSharp Presentation
Ad

Viewers also liked (16)

PDF
FregeFX - JavaFX with Frege, a Haskell for the JVM
PDF
Os Harkins
PDF
Os Keysholistic
PDF
FregeDay: Parallelism in Frege compared to GHC Haskell (Volker Steiss)
PDF
Os Ellistutorial
ODP
Solr Presentation5
PDF
J Ruby Whirlwind Tour
PPT
Os Napier
PDF
Os Keyshacks
PDF
Software Transactional Memory (STM) in Frege
PDF
Frege - consequently functional programming for the JVM
PDF
Frege Tutorial at JavaOne 2015
PDF
Os Raysmith
PDF
Os Peytonjones
PDF
OCaml Labs introduction at OCaml Consortium 2012
PDF
From object oriented to functional domain modeling
FregeFX - JavaFX with Frege, a Haskell for the JVM
Os Harkins
Os Keysholistic
FregeDay: Parallelism in Frege compared to GHC Haskell (Volker Steiss)
Os Ellistutorial
Solr Presentation5
J Ruby Whirlwind Tour
Os Napier
Os Keyshacks
Software Transactional Memory (STM) in Frege
Frege - consequently functional programming for the JVM
Frege Tutorial at JavaOne 2015
Os Raysmith
Os Peytonjones
OCaml Labs introduction at OCaml Consortium 2012
From object oriented to functional domain modeling
Ad

Similar to FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo Wechsung) (20)

PDF
C tour Unix
PDF
javase8bestpractices-151015135520-lva1-app6892
PDF
Java SE 8 best practices
PDF
Software Craftmanship - Cours Polytech
PDF
Java 8 best practices - Stephen Colebourne
PPTX
Coding conventions
PDF
Understanding Implicits in Scala
PDF
Compiler design notes phases of compiler
PPTX
Go Is Your Next Language — Sergii Shapoval
PDF
Boost.Dispatch
PDF
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
PDF
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
PDF
Pattern-Based Debugging of Declarative Models
PPT
14274730 (1).ppt
PPTX
Coding standards for java
PDF
Custom Pregel Algorithms in ArangoDB
PDF
Concurrent Programming in Go basics and programming
PPTX
Go Programming language, golang
PPTX
Dart the Better JavaScript
C tour Unix
javase8bestpractices-151015135520-lva1-app6892
Java SE 8 best practices
Software Craftmanship - Cours Polytech
Java 8 best practices - Stephen Colebourne
Coding conventions
Understanding Implicits in Scala
Compiler design notes phases of compiler
Go Is Your Next Language — Sergii Shapoval
Boost.Dispatch
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Pattern-Based Debugging of Declarative Models
14274730 (1).ppt
Coding standards for java
Custom Pregel Algorithms in ArangoDB
Concurrent Programming in Go basics and programming
Go Programming language, golang
Dart the Better JavaScript

More from Dierk König (6)

PDF
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
PDF
Greach, GroovyFx Workshop
PDF
Monads from Definition
PDF
Quick into to Software Transactional Memory in Frege
PDF
UI Engineer - the missing profession, devoxx 2013
PDF
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
Greach, GroovyFx Workshop
Monads from Definition
Quick into to Software Transactional Memory in Frege
UI Engineer - the missing profession, devoxx 2013
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...

FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo Wechsung)

  • 1. Differences Haskell / Frege Towards making Frege a better Haskell dialect/subset Ingo Wechsung IT Consultant, contexo GmbH Reutlingen, Germany @iwechsu
  • 3. Purpose of this Presentation ● To give a comprehensive overview about really existing differences and what can be done about them. ● Community to ○ discuss if and how to deal with them ○ create corresponding GitHub issues, if applicable ○ actually work on the issues
  • 4. Preliminary notes In the following slides, “Standard” refers to the Haskell 2010 Language Report https://haskell. org/definition/haskell2010.pdf Suggestions and estimations of importances and efforts are my subjective opinions (well founded ones, of course☺).
  • 5. Haskell Compatibility Mode? There are some Frege features that cannot get abandoned without making Frege ● less practical for use on the JVM ● less good than it is When otherwise unresolvable conflicts with the Standard arise, should we have a “haskell compatibility mode” (abbrev. HCM)?
  • 6. Variable names ● Frege: allows apostrophes only at the end, no underscores at start ● Standard: “An identifier consists of a letter followed by zero or more letters, digits, underscores, and single quotes.” (2.4, pg. 9) ● Effort: low (simple fix in lexical analyzer) ● Importance: low ● Suggestions: implement
  • 7. Operator constructors (1) ● Frege: operator constructors are not supported ● Standard: “An operator symbol starting with a colon is a constructor.” (2.4, pg. 10) data Complex = Double :+ Double ● Effort: medium (parsing) ● Importance: high ● Suggestion: implement
  • 8. Operator constructors (2) Note that GHC extension -XTypeOperators in addition allows infix type constructors: Int :& Int :| Double :& Double Implementing this would entail a whole range of changes. The critical point is that types could only get parsed once the fixity of the operators is known. Currently, type parsing is already complete when the parser is done.
  • 9. Octal integer literals ● Frege: Java literal syntax, e.g. 032 == 26 ● Standard: octal literals 0o32 (2.5, pg. 11) ● Effort: low, rewrite literal in lexer ● Importance: low ● Suggestion: implement. Interpret 032 as 32 in HCM. Or just get rid of octal literals entirely.
  • 10. String and Char literals ● Frege: certain escape sequences and gaps in strings (multi line strings) won’t work ● Standard: 2.6, page 11f ● Effort: medium, bikeshedding ● Importance: low ● Suggestion: Need not be done all at once. The gaps feature would be worth having.
  • 11. Meaning of String Literals ● Frege: string literals mean (Java) strings ● Standard: “String literals are actually abbreviations for lists of characters” (2.6, pg. 12) ● Effort: medium ● Importance: high ● Suggestions: overload string literals so that list functions work, follow standard in HCM.
  • 12. Layout (1) ● Frege: no insertion of {} ● Standard: “If the indentation of the non-brace lexeme immediately following a where, let, do or of is less than or equal to the current indentation level, then … {} is inserted …” (2.7, pg. 12) ● Effort: medium ● Importance: medium ● Suggestion: adapt
  • 13. Layout (2) ● Frege: no “syntactic” insertion of closing brace except before in ● Standard: “... if an illegal lexeme is encountered at a point where a close brace would be legal, a close brace is inserted.” (2.7, pg. 12) ● Effort: high (layout is lexical only) ● Importance: low ● Suggestions: try to cover some cases
  • 14. Overloaded Integer literals ● Frege: numeric literals are not overloaded ● Standard: “An integer literal represents the application of the function fromInteger to the appropriate value of type Integer” (3.2, page 17) ● Effort: low, possibly breaks existing code ● Importance: medium ● Suggestions: slightly in favor, but should be done together with floating point literals
  • 15. Overloaded Floating Point Literals ● Standard: “The floating point literal f is equivalent to fromRational (n Ratio.% d ), where fromRational is a method in class Fractional and Ratio.% constructs a rational from two integers, as defined in the Ratio library. The integers n and d are chosen so that n/d = f.” (3.2, pg. 17) ● Effort: high, Fractional and Ratio don’t exist yet ● Importance: high ● Suggestions: first implement needed classes and types. Overloading itself can be done later, or just in HCM.
  • 16. Lambda abstractions ● Frege: only single pattern allowed ● Standard: “Lambda abstractions are written p1 . . . pn -> e, where the pi are patterns.” (3.3, pg. 18) ● Effort: high ● Importance: medium ● Suggestion: would break existing programs that have smth. like: x:xs -> x
  • 17. Field Labels as Selectors ● Frege: field labels (selectors) not top level ● Standard: “Selectors are top level bindings ...” (3.15.1, pg. 26) ● Effort: depending on solution ● Importance: low ● Suggestion: implement in HCM only
  • 18. Construction using Field Labels ● Frege: all field labels must be mentioned ● Standard: Fields not mentioned are initialized to ⊥. (3.15.2, pg. 26) ● Effort: low ● Importance: low ● Suggestions: HCM only
  • 19. Updates Using Field Labels ● Frege: slightly different syntax ● Standard: “aexp<qcon> { fbind1 , . . . , fbind n }” (3.15.3, pg. 27) ● Effort: low ● Importance: medium ● Suggestions: implement, retire Frege dot- syntax
  • 20. Pattern syntax ● Frege: uses expression syntax ● Standard: defines extra syntax for patterns (3.17.1, page 28), makes @ and ~ reserved symbols ● Effort: surprisingly high, breaks Frege code ● Importance: high ● Suggestion: ???
  • 21. Negative Patterns ● Frege: not supported ● Standard: allows them with numeric literals (3.17.1, page 28) ● Effort: medium ● Importance: medium ● Suggestions: implement
  • 22. Irrefutable pattern ● Frege: not supported ● Standard: ~apat (3.17.1, page 28) ● Effort, Importance, Suggestions: see “Pattern syntax”
  • 23. Context in Data Declaration ● Frege: not allowed ● Standard: data [context =>] simpletype [= constrs] (4.2.1, page 40) ● Effort: medium ● Importance: very low ● Suggestion: don’t implement, as it is considered bad practice anyway
  • 24. “deriving” clause in data defs ● Frege: has separate derive definition ● Standard: optional deriving clause on data declarations (4.2.1, page 40) ● Effort: medium ● Importance: high, though GHC now also has separate deriving declaration ● Suggestion: implement
  • 25. Datatype renamings ● Frege: can be achieved with data ● Standard: uses newtype for renaming, data has slightly different semantics. (4.2.3, page 43) ● Effort: low/medium ● Importance: high/low ● Suggestion: support syntax, ignore corner data case except in HCM
  • 26. Context in Class/Instance Declarations ● Frege: class name first ● Standard: context first (4.3.1, 4.3.2, pages 44ff) ● Effort: small ● Importance: high ● Suggestion: this stupid error on my side should long have been fixed. Requires adaption of most existing code, though.
  • 27. Numeric Type Defaulting Frege: not done Standard: specifies default declaration Effort: medium Importance: ? Suggestion: In a first step, just the syntax could be implemented.
  • 28. Fixity Declarations ● Frege: top level only ● Standard: has them as nested declarations, they can appear in class declarations and let/where (4.4.2, page 50) ● Effort: medium ● Importance: low ● Suggestions: follow standard
  • 29. Mutually Recursive Modules ● Frege modules form a directed acyclic graph ● Standard: “allowed to be mutually recursive” (5, page 62) ● Effort: quite high ● Importance: low? ● Suggestions: don’t touch for now.
  • 30. Optional Module Header ● Frege: module header is mandatory ● Standard: “An abbreviated form of module, consisting only of the module body, is permitted.” (5.1, page 62) ● Importance: low ● Effort: low ● Suggestion: implement
  • 31. Modules - Export Lists ● tell what can be imported by other modules ● in Frege, we have private/public/protected ● Effort: medium .. very high ● Importance: medium ● Suggestions: do this in multiple steps a. parse them, but ignore them (everything public) b. default to “private” when present c. retire private/public/protected
  • 32. Import Declarations ● Frege ○ doesn’t allow qualified names as module aliases ○ instead, all module names are mapped to namespace names ○ doesn’t have the (..) syntax for “all sub-items” ○ doesn’t have qualified ● Standard: 5.3, pages 64ff. ● Suggestion: handle diffs in HCM
  • 33. Comparison Haskell/Frege Imports import A.B -- all import A.B() -- none import A.B(T(C)) import A.B(T(..)) import A.B(T) import A.B(T()) import qualified A import qualified A() import a.B -- all import a.B() -- none import a.B(T(C)) import a.B(T) import a.B(T()) import a.B(T()) import A() -- makes no sense
  • 34. Qualified Names and Module Names ● Frege uses module names only for imports. Thereafter, only the namespace name can be used for qualification. ● Standard: modid.name (5.5.1, page 67) ● Importance: low ● Effort: impossible ● Suggestion: leave as is
  • 35. Standard Type Boolean ● Frege uses primitive JVM type: data Bool = pure native boolean Keyword literals true and false are provided. ● Standard: “The boolean type Bool is an enumeration.” data Bool = False | True ● Importance: high ● Suggestion: cheat in the compiler
  • 36. Characters ● Frege Char are UTF-16 values ● Standard: “The character type Char is an enumeration whose values represent Unicode characters” (6.1.2, page 73) ● Importance: low (?) ● Effort: hack JVM ● Suggestions: hope for JVM evolution
  • 37. Strings ● Frege uses native java.lang.String type ● Standard: “A string is a list of characters” (6.1.2, page 73) ● Importance: medium (beginners!) ● Effort: medium ● Suggestion: overload string literals
  • 38. IOERR ● Frege doesn’t have it ● Standard: “IOError is an abstract type representing errors raised by I/O operations.” (6.1.7, page 75) ● Importance: low ● Effort: probably low ● Suggestions: can we get away with type IOERR = IOException
  • 39. class Read, read ● not implemented ● Standard: “The Read ... [class is] used to convert values ... from strings.” (6.3.3, page 78) ● Importance: medium ● Effort: medium ● Suggestions: Implement at least for basic types.
  • 40. Numbers ● Frege doesn’t have all the type classes, no rationals and complex numbers at this time. ● Standard: prescribes a complex web of numeric type classes (6.4, page 81ff) ● Importance: medium ● Effort: high ● Suggestion: needs care. Or a mathematically sound alternative.
  • 41. IO Exception Handling ● Frege uses Java Exceptions ● Standard: IO Exception Handling (7.3, page 90) ● Importance: none ● Effort: N/A ● Suggestion: don’t change
  • 42. Foreign Function Interface ● Frege has its own Native Interface ● Standard: (8, page 91ff) ● Importance: none ● Effort: small ● Suggestion: Haskell sources using standard FFI (i.e. calls into C) are not portable support the foreign import/export syntax though?
  • 43. Haskell 2010 Libraries ● missing, should be done: ○ Data.Array, Data.Complex, Data.Int, Data.Ix, Data. Ratio, Data.Word, Numeric, System.Environment, System.Exit ● present (may be incomplete) : ○ Data.Bits, Data.Char, Data.List, Data.Maybe ● not done: ○ Foreign, Foreign.*, System.IO, System.IO.Error ● obsolete: Control.Monad
  • 44. Conclusion ● we have a long way to go ● much work to be done ● much can be done to enhance “Haskellnes”
  • 45. Background, Pointers & Links ● Haskell 2010 Language Report ● GHC Language System ● Frege Wiki ○ https://github.com/Frege/frege/wiki/GHC- Language-Options-vs.-Frege ○ https://github.com/Frege/frege/wiki/Differences- between-Frege-and-Haskell