Fix bad inference on case expression, and make pretty for report
This commit is contained in:
parent
29de6c49e4
commit
a109b3010d
6 changed files with 406 additions and 391 deletions
|
|
@ -2,7 +2,14 @@ data Bool () where
|
|||
True : Bool ()
|
||||
False : Bool ()
|
||||
|
||||
main : Bool () -> a -> Int
|
||||
main b = case b of
|
||||
False => (\x. 1)
|
||||
True => (\x. 0)
|
||||
-- Both valid
|
||||
-- f : Bool () -> a -> Int
|
||||
f : Bool () -> (forall a. a -> Int)
|
||||
f b = case b of
|
||||
False => (\x. 0 : forall a. a -> Int)
|
||||
True => (\x. 1 : forall a. a -> Int)
|
||||
|
||||
|
||||
main : Int
|
||||
main = (f True) 'h'
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ data Bool () where
|
|||
True : Bool ()
|
||||
False : Bool ()
|
||||
|
||||
ifThenElse : forall a. Bool () -> a -> a -> a
|
||||
ifThenElse : Bool () -> a -> a -> a
|
||||
ifThenElse b if else = case b of
|
||||
True => if
|
||||
False => else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue