diff options
-rw-r--r-- | src/LambdaCube/Compiler/DesugaredSource.hs | 4 | ||||
-rw-r--r-- | src/LambdaCube/Compiler/Parser.hs | 2 | ||||
-rw-r--r-- | src/LambdaCube/Compiler/Pretty.hs | 9 | ||||
-rw-r--r-- | testdata/Builtins.out | 6 | ||||
-rw-r--r-- | testdata/Internals.out | 4 | ||||
-rw-r--r-- | testdata/Prelude.out | 110 | ||||
-rw-r--r-- | testdata/language-features/basic-values/fixity01.out | 8 | ||||
-rw-r--r-- | testdata/language-features/basic-values/fixity02.out | 8 | ||||
-rw-r--r-- | testdata/language-features/basic-values/operator01.out | 16 | ||||
-rw-r--r-- | testdata/language-features/basic-values/operator02.reject.out | 4 | ||||
-rw-r--r-- | testdata/language-features/basic-values/typesig06.out | 4 | ||||
-rw-r--r-- | testdata/language-features/basic-values/typesig07.out | 4 | ||||
-rw-r--r-- | testdata/language-features/section/section01.out | 4 | ||||
-rw-r--r-- | testdata/typeclass.out | 16 |
14 files changed, 102 insertions, 97 deletions
diff --git a/src/LambdaCube/Compiler/DesugaredSource.hs b/src/LambdaCube/Compiler/DesugaredSource.hs index c4e1eb1e..3f1cbc1a 100644 --- a/src/LambdaCube/Compiler/DesugaredSource.hs +++ b/src/LambdaCube/Compiler/DesugaredSource.hs | |||
@@ -144,7 +144,7 @@ instance Ord SIName where compare = compare `on` sName | |||
144 | --instance Show SIName where show = sName | 144 | --instance Show SIName where show = sName |
145 | instance PShow SIName | 145 | instance PShow SIName |
146 | where | 146 | where |
147 | pShow (SIName_ si f n) = expand (maybe (text n) (DOp0 n) f) $ case si of | 147 | pShow (SIName_ si f n) = expand (if isOpName n then DOp0 n (defaultFixity f) else maybe (text n) (DOp0 n) f) $ case si of |
148 | NoSI{} -> text n --maybe (text n) (DOp0 n) f | 148 | NoSI{} -> text n --maybe (text n) (DOp0 n) f |
149 | _ -> pShow si | 149 | _ -> pShow si |
150 | 150 | ||
@@ -447,7 +447,7 @@ instance PShow Stmt where | |||
447 | Primitive n t -> shAnn (pShow n) (pShow t) | 447 | Primitive n t -> shAnn (pShow n) (pShow t) |
448 | Let n ty e -> DLet "=" (pShow n) $ maybe (pShow e) (\ty -> shAnn (pShow e) (pShow ty)) ty | 448 | Let n ty e -> DLet "=" (pShow n) $ maybe (pShow e) (\ty -> shAnn (pShow e) (pShow ty)) ty |
449 | Data n ps ty cs -> nest 2 $ "data" <+> nest 2 (shAnn (foldl dApp (DTypeNamespace True $ pShow n) [shAnn (text "_") (pShow t) | (v, t) <- ps]) (pShow ty)) </> "where" <> nest 2 (hardline <> vcat [shAnn (pShow n) $ pShow $ UncurryS (first (const Hidden) <$> ps) t | (n, t) <- cs]) | 449 | Data n ps ty cs -> nest 2 $ "data" <+> nest 2 (shAnn (foldl dApp (DTypeNamespace True $ pShow n) [shAnn (text "_") (pShow t) | (v, t) <- ps]) (pShow ty)) </> "where" <> nest 2 (hardline <> vcat [shAnn (pShow n) $ pShow $ UncurryS (first (const Hidden) <$> ps) t | (n, t) <- cs]) |
450 | PrecDef n i -> pShow i <+> shortForm (pShow n) --DOp0 (sName n) i | 450 | PrecDef n i -> pShow i <+> text (sName n) --DOp0 (sName n) i |
451 | 451 | ||
452 | instance DeBruijnify SIName Stmt where | 452 | instance DeBruijnify SIName Stmt where |
453 | deBruijnify_ k v = \case | 453 | deBruijnify_ k v = \case |
diff --git a/src/LambdaCube/Compiler/Parser.hs b/src/LambdaCube/Compiler/Parser.hs index 50a1632b..9350f9fd 100644 --- a/src/LambdaCube/Compiler/Parser.hs +++ b/src/LambdaCube/Compiler/Parser.hs | |||
@@ -106,7 +106,7 @@ instance Monoid DesugarInfo where | |||
106 | addFixity :: BodyParser SIName -> BodyParser SIName | 106 | addFixity :: BodyParser SIName -> BodyParser SIName |
107 | addFixity p = f <$> asks (fixityMap . desugarInfo) <*> p | 107 | addFixity p = f <$> asks (fixityMap . desugarInfo) <*> p |
108 | where | 108 | where |
109 | f fm sn@(SIName_ si _ n) = SIName_ si (Just $ fromMaybe (InfixL 9) $ Map.lookup n fm) n | 109 | f fm sn@(SIName_ si _ n) = SIName_ si (Just $ defaultFixity $ Map.lookup n fm) n |
110 | 110 | ||
111 | addFixity' :: BodyParser SIName -> BodyParser SIName | 111 | addFixity' :: BodyParser SIName -> BodyParser SIName |
112 | addFixity' p = f <$> asks (fixityMap . desugarInfo) <*> p | 112 | addFixity' p = f <$> asks (fixityMap . desugarInfo) <*> p |
diff --git a/src/LambdaCube/Compiler/Pretty.hs b/src/LambdaCube/Compiler/Pretty.hs index fe917fa6..034df19d 100644 --- a/src/LambdaCube/Compiler/Pretty.hs +++ b/src/LambdaCube/Compiler/Pretty.hs | |||
@@ -13,7 +13,7 @@ module LambdaCube.Compiler.Pretty | |||
13 | ( module LambdaCube.Compiler.Pretty | 13 | ( module LambdaCube.Compiler.Pretty |
14 | ) where | 14 | ) where |
15 | 15 | ||
16 | --import Data.Monoid | 16 | import Data.Maybe |
17 | import Data.String | 17 | import Data.String |
18 | import Data.Char | 18 | import Data.Char |
19 | --import qualified Data.Set as Set | 19 | --import qualified Data.Set as Set |
@@ -57,6 +57,9 @@ leftPrecedence f = precedence f + 1 | |||
57 | rightPrecedence (InfixR i) = i | 57 | rightPrecedence (InfixR i) = i |
58 | rightPrecedence f = precedence f + 1 | 58 | rightPrecedence f = precedence f + 1 |
59 | 59 | ||
60 | defaultFixity :: Maybe Fixity -> Fixity | ||
61 | defaultFixity = fromMaybe (InfixL 9) | ||
62 | |||
60 | -------------------------------------------------------------------------------- doc data type | 63 | -------------------------------------------------------------------------------- doc data type |
61 | 64 | ||
62 | data Doc | 65 | data Doc |
@@ -243,7 +246,9 @@ renderDoc | |||
243 | isAlph c = isAlphaNum c || c `elem` ("'_" :: String) | 246 | isAlph c = isAlphaNum c || c `elem` ("'_" :: String) |
244 | isOpen c = c `elem` ("({[" :: String) | 247 | isOpen c = c `elem` ("({[" :: String) |
245 | isClose c = c `elem` (")}]" :: String) | 248 | isClose c = c `elem` (")}]" :: String) |
246 | --graphicChar = (`elem` ("#<>!.:^&@|-+*/\\~%=$" :: String)) | 249 | |
250 | isOpName (c:cs) | c `elem` ("#<>!.:^&@|-+*/\\~%=$" :: String) = True | ||
251 | isOpName _ = False | ||
247 | 252 | ||
248 | -------------------------------------------------------------------------- combinators | 253 | -------------------------------------------------------------------------- combinators |
249 | 254 | ||
diff --git a/testdata/Builtins.out b/testdata/Builtins.out index 01a4d378..351b6558 100644 --- a/testdata/Builtins.out +++ b/testdata/Builtins.out | |||
@@ -650,7 +650,7 @@ head | |||
650 | (_rhs undefined) | 650 | (_rhs undefined) |
651 | (\(b :: _) _ -> _rhs b) | 651 | (\(b :: _) _ -> _rhs b) |
652 | a | 652 | a |
653 | ++ | 653 | (++) |
654 | = \(a :: _) (b :: _) -> case'List | 654 | = \(a :: _) (b :: _) -> case'List |
655 | (\_ -> _ :: _) | 655 | (\_ -> _ :: _) |
656 | (_rhs b) | 656 | (_rhs b) |
@@ -662,7 +662,7 @@ foldr | |||
662 | (_rhs b) | 662 | (_rhs b) |
663 | (\(d :: _) (e :: _) -> _rhs (a d (foldr a b e))) | 663 | (\(d :: _) (e :: _) -> _rhs (a d (foldr a b e))) |
664 | c | 664 | c |
665 | concat = _rhs (foldr ++ []) | 665 | concat = _rhs (foldr (++) []) |
666 | map | 666 | map |
667 | = \(a :: _) (b :: _) -> case'List | 667 | = \(a :: _) (b :: _) -> case'List |
668 | (\_ -> _ :: _) | 668 | (\_ -> _ :: _) |
@@ -1228,7 +1228,7 @@ PrimNoise2 :: forall (a :: Nat) . VecScalar a Float -> Vec 2 Float | |||
1228 | PrimNoise3 :: forall (a :: Nat) . VecScalar a Float -> Vec 3 Float | 1228 | PrimNoise3 :: forall (a :: Nat) . VecScalar a Float -> Vec 3 Float |
1229 | PrimNoise4 :: forall (a :: Nat) . VecScalar a Float -> Vec 4 Float | 1229 | PrimNoise4 :: forall (a :: Nat) . VecScalar a Float -> Vec 4 Float |
1230 | head :: forall a . [a] -> a | 1230 | head :: forall a . [a] -> a |
1231 | ++ :: forall a . [a] -> [a] -> [a] | 1231 | (++) :: forall a . [a] -> [a] -> [a] |
1232 | foldr :: forall a b . (b -> a -> a) -> a -> [b] -> a | 1232 | foldr :: forall a b . (b -> a -> a) -> a -> [b] -> a |
1233 | concat :: forall a . [[a]] -> [a] | 1233 | concat :: forall a . [[a]] -> [a] |
1234 | map :: forall a b . (a -> b) -> [a] -> [b] | 1234 | map :: forall a b . (a -> b) -> [a] -> [b] |
diff --git a/testdata/Internals.out b/testdata/Internals.out index c76420ae..78586125 100644 --- a/testdata/Internals.out +++ b/testdata/Internals.out | |||
@@ -155,7 +155,7 @@ negate | |||
155 | a | 155 | a |
156 | (_rhs ('Empty "no instance of 'Eq on ???")))))))) | 156 | (_rhs ('Empty "no instance of 'Eq on ???")))))))) |
157 | :: Type -> Type | 157 | :: Type -> Type |
158 | == | 158 | (==) |
159 | = (\ @a @_ -> match'String | 159 | = (\ @a @_ -> match'String |
160 | (\_ -> _) | 160 | (\_ -> _) |
161 | (_rhs \(b := \(c :: _) (d :: _) -> _rhs (isEQ (primCompareString c d))) -> b) | 161 | (_rhs \(b := \(c :: _) (d :: _) -> _rhs (isEQ (primCompareString c d))) -> b) |
@@ -294,7 +294,7 @@ fromInt :: forall a . Num a => Int -> a | |||
294 | compare :: forall a . Num a => a -> a -> Ordering | 294 | compare :: forall a . Num a => a -> a -> Ordering |
295 | negate :: forall a . Num a => a -> a | 295 | negate :: forall a . Num a => a -> a |
296 | 'Eq :: Type -> Type | 296 | 'Eq :: Type -> Type |
297 | == :: forall a . Eq a => a -> a -> Bool | 297 | (==) :: forall a . Eq a => a -> a -> Bool |
298 | 'List :: Type -> Type | 298 | 'List :: Type -> Type |
299 | [] :: forall a . [a] | 299 | [] :: forall a . [a] |
300 | (:) :: forall a . a -> [a] -> [a] | 300 | (:) :: forall a . a -> [a] -> [a] |
diff --git a/testdata/Prelude.out b/testdata/Prelude.out index 0d9a2657..971fc3a3 100644 --- a/testdata/Prelude.out +++ b/testdata/Prelude.out | |||
@@ -7,9 +7,9 @@ infixr 3 *** | |||
7 | infixr 0 $ | 7 | infixr 0 $ |
8 | const = \(a :: _) _ -> _rhs a | 8 | const = \(a :: _) _ -> _rhs a |
9 | otherwise = _rhs True | 9 | otherwise = _rhs True |
10 | & = \(a :: _) (b :: _) -> _rhs (b a) | 10 | (&) = \(a :: _) (b :: _) -> _rhs (b a) |
11 | $ = _rhs \(a :: _) (b :: _) -> a b | 11 | ($) = _rhs \(a :: _) (b :: _) -> a b |
12 | . = _rhs \(a :: _) (b :: _) (c :: _) -> a (b c) | 12 | (.) = _rhs \(a :: _) (b :: _) (c :: _) -> a (b c) |
13 | uncurry | 13 | uncurry |
14 | = \(a :: _) (b :: _) -> hlistConsCase | 14 | = \(a :: _) (b :: _) -> hlistConsCase |
15 | (_ :: _) | 15 | (_ :: _) |
@@ -18,7 +18,7 @@ uncurry | |||
18 | (\(e :: _) (f :: _) -> hlistNilCase (_ :: _) (_rhs (a c e)) f) | 18 | (\(e :: _) (f :: _) -> hlistNilCase (_ :: _) (_rhs (a c e)) f) |
19 | d) | 19 | d) |
20 | b | 20 | b |
21 | *** | 21 | (***) |
22 | = \(a :: _) (b :: _) (c :: _) -> hlistConsCase | 22 | = \(a :: _) (b :: _) (c :: _) -> hlistConsCase |
23 | (_ :: _) | 23 | (_ :: _) |
24 | (\(d :: _) (e :: _) -> hlistConsCase | 24 | (\(d :: _) (e :: _) -> hlistConsCase |
@@ -180,9 +180,9 @@ snd | |||
180 | (\(c :: _) (d :: _) -> hlistNilCase (_ :: _) (_rhs c) d) | 180 | (\(c :: _) (d :: _) -> hlistNilCase (_ :: _) (_rhs c) d) |
181 | b) | 181 | b) |
182 | a | 182 | a |
183 | ||| = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs b) (_rhs True) a | 183 | (|||) = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs b) (_rhs True) a |
184 | infixr 2 ||| | 184 | infixr 2 ||| |
185 | &&& = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs False) (_rhs b) a | 185 | (&&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs False) (_rhs b) a |
186 | infixr 3 &&& | 186 | infixr 3 &&& |
187 | data RecItem :: Type where | 187 | data RecItem :: Type where |
188 | RecItem :: String -> Type -> RecItem | 188 | RecItem :: String -> Type -> RecItem |
@@ -346,36 +346,36 @@ infix 7 cross | |||
346 | infixr 7 *. | 346 | infixr 7 *. |
347 | infixl 7 .* | 347 | infixl 7 .* |
348 | infixl 7 .*. | 348 | infixl 7 .*. |
349 | + = \(a :: _) (b :: _) -> _rhs (PrimAdd a b) | 349 | (+) = \(a :: _) (b :: _) -> _rhs (PrimAdd a b) |
350 | - = \(a :: _) (b :: _) -> _rhs (PrimSub a b) | 350 | (-) = \(a :: _) (b :: _) -> _rhs (PrimSub a b) |
351 | * = \(a :: _) (b :: _) -> _rhs (PrimMul a b) | 351 | (*) = \(a :: _) (b :: _) -> _rhs (PrimMul a b) |
352 | / = \(a :: _) (b :: _) -> _rhs (PrimDiv a b) | 352 | (/) = \(a :: _) (b :: _) -> _rhs (PrimDiv a b) |
353 | % = \(a :: _) (b :: _) -> _rhs (PrimMod a b) | 353 | (%) = \(a :: _) (b :: _) -> _rhs (PrimMod a b) |
354 | neg = \(a :: _) -> _rhs (PrimNeg a) | 354 | neg = \(a :: _) -> _rhs (PrimNeg a) |
355 | /= = \(a :: _) (b :: _) -> _rhs (PrimNotEqual a b) | 355 | (/=) = \(a :: _) (b :: _) -> _rhs (PrimNotEqual a b) |
356 | < = \(a :: _) (b :: _) -> _rhs (PrimLessThan a b) | 356 | (<) = \(a :: _) (b :: _) -> _rhs (PrimLessThan a b) |
357 | <= = \(a :: _) (b :: _) -> _rhs (PrimLessThanEqual a b) | 357 | (<=) = \(a :: _) (b :: _) -> _rhs (PrimLessThanEqual a b) |
358 | >= = \(a :: _) (b :: _) -> _rhs (PrimGreaterThanEqual a b) | 358 | (>=) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThanEqual a b) |
359 | > = \(a :: _) (b :: _) -> _rhs (PrimGreaterThan a b) | 359 | (>) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThan a b) |
360 | && = \(a :: _) (b :: _) -> _rhs (PrimAnd a b) | 360 | (&&) = \(a :: _) (b :: _) -> _rhs (PrimAnd a b) |
361 | || = \(a :: _) (b :: _) -> _rhs (PrimOr a b) | 361 | (||) = \(a :: _) (b :: _) -> _rhs (PrimOr a b) |
362 | xor = _rhs PrimXor | 362 | xor = _rhs PrimXor |
363 | not = \(a :: _) -> _rhs (PrimNot a) | 363 | not = \(a :: _) -> _rhs (PrimNot a) |
364 | any = \(a :: _) -> _rhs (PrimAny a) | 364 | any = \(a :: _) -> _rhs (PrimAny a) |
365 | all = \(a :: _) -> _rhs (PrimAll a) | 365 | all = \(a :: _) -> _rhs (PrimAll a) |
366 | .*. = \(a :: _) (b :: _) -> _rhs (PrimMulMatMat a b) | 366 | (.*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatMat a b) |
367 | *. = \(a :: _) (b :: _) -> _rhs (PrimMulMatVec a b) | 367 | (*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatVec a b) |
368 | .* = \(a :: _) (b :: _) -> _rhs (PrimMulVecMat a b) | 368 | (.*) = \(a :: _) (b :: _) -> _rhs (PrimMulVecMat a b) |
369 | infixl 7 *! | 369 | infixl 7 *! |
370 | infixl 7 /! | 370 | infixl 7 /! |
371 | infixl 7 %! | 371 | infixl 7 %! |
372 | infixl 6 +! | 372 | infixl 6 +! |
373 | infixl 6 -! | 373 | infixl 6 -! |
374 | +! = \(a :: _) (b :: _) -> _rhs (PrimAddS a b) | 374 | (+!) = \(a :: _) (b :: _) -> _rhs (PrimAddS a b) |
375 | -! = \(a :: _) (b :: _) -> _rhs (PrimSubS a b) | 375 | (-!) = \(a :: _) (b :: _) -> _rhs (PrimSubS a b) |
376 | *! = \(a :: _) (b :: _) -> _rhs (PrimMulS a b) | 376 | (*!) = \(a :: _) (b :: _) -> _rhs (PrimMulS a b) |
377 | /! = \(a :: _) (b :: _) -> _rhs (PrimDivS a b) | 377 | (/!) = \(a :: _) (b :: _) -> _rhs (PrimDivS a b) |
378 | %! = \(a :: _) (b :: _) -> _rhs (PrimModS a b) | 378 | (%!) = \(a :: _) (b :: _) -> _rhs (PrimModS a b) |
379 | perspective | 379 | perspective |
380 | = (\(a :: _) (b :: _) (c :: _) (d :: _) -> _rhs | 380 | = (\(a :: _) (b :: _) (c :: _) (d :: _) -> _rhs |
381 | \(e := _rhs (a * tan (c / fromInt 2))) | 381 | \(e := _rhs (a * tan (c / fromInt 2))) |
@@ -459,7 +459,7 @@ fromTo | |||
459 | (_rhs []) | 459 | (_rhs []) |
460 | (a > b)) | 460 | (a > b)) |
461 | :: Float -> Float -> [Float] | 461 | :: Float -> Float -> [Float] |
462 | !! | 462 | (!!) |
463 | = (\(a :: _) (b :: _) -> case'List | 463 | = (\(a :: _) (b :: _) -> case'List |
464 | (\_ -> _ :: _) | 464 | (\_ -> _ :: _) |
465 | (_rhs undefined) | 465 | (_rhs undefined) |
@@ -474,11 +474,11 @@ main is not found | |||
474 | ------------ trace | 474 | ------------ trace |
475 | const :: forall a b . a -> b -> a | 475 | const :: forall a b . a -> b -> a |
476 | otherwise :: Bool | 476 | otherwise :: Bool |
477 | & :: forall a b . a -> (a -> b) -> b | 477 | (&) :: forall a b . a -> (a -> b) -> b |
478 | $ :: forall a b . (a -> b) -> a -> b | 478 | ($) :: forall a b . (a -> b) -> a -> b |
479 | . :: forall a b c . (b -> c) -> (a -> b) -> a -> c | 479 | (.) :: forall a b c . (b -> c) -> (a -> b) -> a -> c |
480 | uncurry :: forall a b c . (a -> c -> b) -> (a, c) -> b | 480 | uncurry :: forall a b c . (a -> c -> b) -> (a, c) -> b |
481 | *** :: forall a b c d . (a -> c) -> (b -> d) -> (a, b) -> (c, d) | 481 | (***) :: forall a b c d . (a -> c) -> (b -> d) -> (a, b) -> (c, d) |
482 | pi :: Float | 482 | pi :: Float |
483 | zip :: forall a b . [a] -> [b] -> [(a, b)] | 483 | zip :: forall a b . [a] -> [b] -> [(a, b)] |
484 | unzip :: forall a b . [(a, b)] -> ([a], [b]) | 484 | unzip :: forall a b . [(a, b)] -> ([a], [b]) |
@@ -493,8 +493,8 @@ sortBy :: forall a . (a -> a -> Ordering) -> [a] -> [a] | |||
493 | iterate :: forall a . (a -> a) -> a -> [a] | 493 | iterate :: forall a . (a -> a) -> a -> [a] |
494 | fst :: forall a b . (a, b) -> a | 494 | fst :: forall a b . (a, b) -> a |
495 | snd :: forall a b . (a, b) -> b | 495 | snd :: forall a b . (a, b) -> b |
496 | ||| :: Bool -> Bool -> Bool | 496 | (|||) :: Bool -> Bool -> Bool |
497 | &&& :: Bool -> Bool -> Bool | 497 | (&&&) :: Bool -> Bool -> Bool |
498 | 'RecItem :: Type | 498 | 'RecItem :: Type |
499 | RecItem :: String -> Type -> RecItem | 499 | RecItem :: String -> Type -> RecItem |
500 | case'RecItem | 500 | case'RecItem |
@@ -635,45 +635,45 @@ floatBitsToInt :: forall (a :: Nat) . VecScalar a Float -> VecScalar a Int | |||
635 | floatBitsToWord :: forall (a :: Nat) . VecScalar a Float -> VecScalar a Word | 635 | floatBitsToWord :: forall (a :: Nat) . VecScalar a Float -> VecScalar a Word |
636 | intBitsToFloat :: forall (a :: Nat) . VecScalar a Int -> VecScalar a Float | 636 | intBitsToFloat :: forall (a :: Nat) . VecScalar a Int -> VecScalar a Float |
637 | wordBitsToFloat :: forall (a :: Nat) . VecScalar a Word -> VecScalar a Float | 637 | wordBitsToFloat :: forall (a :: Nat) . VecScalar a Word -> VecScalar a Float |
638 | + :: forall a . Num (MatVecScalarElem a) => a -> a -> a | 638 | (+) :: forall a . Num (MatVecScalarElem a) => a -> a -> a |
639 | - :: forall a . Num (MatVecScalarElem a) => a -> a -> a | 639 | (-) :: forall a . Num (MatVecScalarElem a) => a -> a -> a |
640 | * :: forall a . Num (MatVecScalarElem a) => a -> a -> a | 640 | (*) :: forall a . Num (MatVecScalarElem a) => a -> a -> a |
641 | / | 641 | (/) |
642 | :: forall a (b :: Nat) | 642 | :: forall a (b :: Nat) |
643 | . Num a => VecScalar b a -> VecScalar b a -> VecScalar b a | 643 | . Num a => VecScalar b a -> VecScalar b a -> VecScalar b a |
644 | % | 644 | (%) |
645 | :: forall a (b :: Nat) | 645 | :: forall a (b :: Nat) |
646 | . Num a => VecScalar b a -> VecScalar b a -> VecScalar b a | 646 | . Num a => VecScalar b a -> VecScalar b a -> VecScalar b a |
647 | neg :: forall a . Signed (MatVecScalarElem a) => a -> a | 647 | neg :: forall a . Signed (MatVecScalarElem a) => a -> a |
648 | /= :: forall a . a -> a -> Bool | 648 | (/=) :: forall a . a -> a -> Bool |
649 | < | 649 | (<) |
650 | :: forall (a :: Nat) b | 650 | :: forall (a :: Nat) b |
651 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool | 651 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool |
652 | <= | 652 | (<=) |
653 | :: forall (a :: Nat) b | 653 | :: forall (a :: Nat) b |
654 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool | 654 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool |
655 | >= | 655 | (>=) |
656 | :: forall (a :: Nat) b | 656 | :: forall (a :: Nat) b |
657 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool | 657 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool |
658 | > | 658 | (>) |
659 | :: forall (a :: Nat) b | 659 | :: forall (a :: Nat) b |
660 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool | 660 | . Num b => VecScalar a b -> VecScalar a b -> VecScalar a Bool |
661 | && :: Bool -> Bool -> Bool | 661 | (&&) :: Bool -> Bool -> Bool |
662 | || :: Bool -> Bool -> Bool | 662 | (||) :: Bool -> Bool -> Bool |
663 | xor :: Bool -> Bool -> Bool | 663 | xor :: Bool -> Bool -> Bool |
664 | not :: forall (a :: Nat) . VecScalar a Bool -> VecScalar a Bool | 664 | not :: forall (a :: Nat) . VecScalar a Bool -> VecScalar a Bool |
665 | any :: forall (a :: Nat) . VecScalar a Bool -> Bool | 665 | any :: forall (a :: Nat) . VecScalar a Bool -> Bool |
666 | all :: forall (a :: Nat) . VecScalar a Bool -> Bool | 666 | all :: forall (a :: Nat) . VecScalar a Bool -> Bool |
667 | .*. | 667 | (.*.) |
668 | :: forall (a :: Nat) (b :: Nat) c (d :: Nat) | 668 | :: forall (a :: Nat) (b :: Nat) c (d :: Nat) |
669 | . Mat a b c -> Mat b d c -> Mat a d c | 669 | . Mat a b c -> Mat b d c -> Mat a d c |
670 | *. :: forall (a :: Nat) (b :: Nat) c . Mat a b c -> VecS c b -> Vec a c | 670 | (*.) :: forall (a :: Nat) (b :: Nat) c . Mat a b c -> VecS c b -> Vec a c |
671 | .* :: forall (a :: Nat) b (c :: Nat) . VecS b a -> Mat a c b -> Vec c b | 671 | (.*) :: forall (a :: Nat) b (c :: Nat) . VecS b a -> Mat a c b -> Vec c b |
672 | +! :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | 672 | (+!) :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a |
673 | -! :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | 673 | (-!) :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a |
674 | *! :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | 674 | (*!) :: forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a |
675 | /! :: forall a (b :: Nat) . Num a => VecScalar b a -> a -> VecScalar b a | 675 | (/!) :: forall a (b :: Nat) . Num a => VecScalar b a -> a -> VecScalar b a |
676 | %! :: forall a (b :: Nat) . Num a => VecScalar b a -> a -> VecScalar b a | 676 | (%!) :: forall a (b :: Nat) . Num a => VecScalar b a -> a -> VecScalar b a |
677 | perspective :: Float -> Float -> Float -> Float -> Mat 4 4 Float | 677 | perspective :: Float -> Float -> Float -> Float -> Mat 4 4 Float |
678 | rotMatrixZ :: VecScalar 1 Float -> Mat 4 4 Float | 678 | rotMatrixZ :: VecScalar 1 Float -> Mat 4 4 Float |
679 | rotMatrixY :: VecScalar 1 Float -> Mat 4 4 Float | 679 | rotMatrixY :: VecScalar 1 Float -> Mat 4 4 Float |
@@ -683,7 +683,7 @@ translateBefore4 :: Vec 3 Float -> Mat 4 4 Float | |||
683 | lookat :: Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float | 683 | lookat :: Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float |
684 | scale :: Float -> VecS Float 4 -> VecS Float 4 | 684 | scale :: Float -> VecS Float 4 -> VecS Float 4 |
685 | fromTo :: Float -> Float -> [Float] | 685 | fromTo :: Float -> Float -> [Float] |
686 | !! :: forall a . [a] -> Int -> a | 686 | (!!) :: forall a . [a] -> Int -> a |
687 | ------------ tooltips | 687 | ------------ tooltips |
688 | testdata/Prelude.lc 16:1-16:6 | 688 | testdata/Prelude.lc 16:1-16:6 |
689 | forall a b . a -> b -> a | 689 | forall a b . a -> b -> a |
@@ -3550,4 +3550,4 @@ Uncovered pattern(s) at testdata/Prelude.lc:388:10: | |||
3550 | (x : _) !! 0 = x | 3550 | (x : _) !! 0 = x |
3551 | (_ : xs) !! n = xs !! (n-1) | 3551 | (_ : xs) !! n = xs !! (n-1) |
3552 | Missing case(s): | 3552 | Missing case(s): |
3553 | !! [] _ \ No newline at end of file | 3553 | [] !! _ \ No newline at end of file |
diff --git a/testdata/language-features/basic-values/fixity01.out b/testdata/language-features/basic-values/fixity01.out index 82d3c5a6..bcc2a126 100644 --- a/testdata/language-features/basic-values/fixity01.out +++ b/testdata/language-features/basic-values/fixity01.out | |||
@@ -1,8 +1,8 @@ | |||
1 | ------------ desugared source code | 1 | ------------ desugared source code |
2 | funL = \(a :: _) _ -> _rhs a | 2 | funL = \(a :: _) _ -> _rhs a |
3 | funR = \(a :: _) _ -> _rhs a | 3 | funR = \(a :: _) _ -> _rhs a |
4 | <<<< = \(a :: _) _ -> _rhs a | 4 | (<<<<) = \(a :: _) _ -> _rhs a |
5 | >>>> = \_ (a :: _) -> _rhs a | 5 | (>>>>) = \_ (a :: _) -> _rhs a |
6 | infixr 7 funL | 6 | infixr 7 funL |
7 | infixr 7 <<<< | 7 | infixr 7 <<<< |
8 | infixr 6 >>>> | 8 | infixr 6 >>>> |
@@ -11,8 +11,8 @@ main is not found | |||
11 | ------------ trace | 11 | ------------ trace |
12 | funL :: forall a b . a -> b -> a | 12 | funL :: forall a b . a -> b -> a |
13 | funR :: forall a b . a -> b -> a | 13 | funR :: forall a b . a -> b -> a |
14 | <<<< :: forall a b . a -> b -> a | 14 | (<<<<) :: forall a b . a -> b -> a |
15 | >>>> :: forall a b . a -> b -> b | 15 | (>>>>) :: forall a b . a -> b -> b |
16 | ------------ tooltips | 16 | ------------ tooltips |
17 | testdata/language-features/basic-values/fixity01.lc 1:1-1:5 | 17 | testdata/language-features/basic-values/fixity01.lc 1:1-1:5 |
18 | forall a b . a -> b -> a | 18 | forall a b . a -> b -> a |
diff --git a/testdata/language-features/basic-values/fixity02.out b/testdata/language-features/basic-values/fixity02.out index baf54313..acdd5309 100644 --- a/testdata/language-features/basic-values/fixity02.out +++ b/testdata/language-features/basic-values/fixity02.out | |||
@@ -1,8 +1,8 @@ | |||
1 | ------------ desugared source code | 1 | ------------ desugared source code |
2 | funL = \(a :: _) _ -> _rhs a | 2 | funL = \(a :: _) _ -> _rhs a |
3 | funR = \_ (a :: _) -> _rhs a | 3 | funR = \_ (a :: _) -> _rhs a |
4 | <@ = \(a :: _) _ -> _rhs a | 4 | (<@) = \(a :: _) _ -> _rhs a |
5 | @> = \_ (a :: _) -> _rhs a | 5 | (@>) = \_ (a :: _) -> _rhs a |
6 | infixr 7 funL | 6 | infixr 7 funL |
7 | infixr 7 <@ | 7 | infixr 7 <@ |
8 | infixr 6 @> | 8 | infixr 6 @> |
@@ -27,8 +27,8 @@ main is not found | |||
27 | ------------ trace | 27 | ------------ trace |
28 | funL :: forall a b . a -> b -> a | 28 | funL :: forall a b . a -> b -> a |
29 | funR :: forall a b . a -> b -> b | 29 | funR :: forall a b . a -> b -> b |
30 | <@ :: forall a b . a -> b -> a | 30 | (<@) :: forall a b . a -> b -> a |
31 | @> :: forall a b . a -> b -> b | 31 | (@>) :: forall a b . a -> b -> b |
32 | value1 :: Float | 32 | value1 :: Float |
33 | value2 :: Float | 33 | value2 :: Float |
34 | value3 :: Float | 34 | value3 :: Float |
diff --git a/testdata/language-features/basic-values/operator01.out b/testdata/language-features/basic-values/operator01.out index 96aefcdc..b6848082 100644 --- a/testdata/language-features/basic-values/operator01.out +++ b/testdata/language-features/basic-values/operator01.out | |||
@@ -1,14 +1,14 @@ | |||
1 | ------------ desugared source code | 1 | ------------ desugared source code |
2 | #$# = \_ _ -> _rhs HNil | 2 | (#$#) = \_ _ -> _rhs HNil |
3 | $$# = \_ _ -> _rhs HNil | 3 | ($$#) = \_ _ -> _rhs HNil |
4 | $$$# = \_ _ -> _rhs HNil | 4 | ($$$#) = \_ _ -> _rhs HNil |
5 | $$$ = \_ _ -> _rhs HNil | 5 | ($$$) = \_ _ -> _rhs HNil |
6 | main is not found | 6 | main is not found |
7 | ------------ trace | 7 | ------------ trace |
8 | #$# :: forall a b . a -> b -> () | 8 | (#$#) :: forall a b . a -> b -> () |
9 | $$# :: forall a b . a -> b -> () | 9 | ($$#) :: forall a b . a -> b -> () |
10 | $$$# :: forall a b . a -> b -> () | 10 | ($$$#) :: forall a b . a -> b -> () |
11 | $$$ :: forall a b . a -> b -> () | 11 | ($$$) :: forall a b . a -> b -> () |
12 | ------------ tooltips | 12 | ------------ tooltips |
13 | testdata/language-features/basic-values/operator01.lc 1:3-1:6 | 13 | testdata/language-features/basic-values/operator01.lc 1:3-1:6 |
14 | forall a b . a -> b -> () | 14 | forall a b . a -> b -> () |
diff --git a/testdata/language-features/basic-values/operator02.reject.out b/testdata/language-features/basic-values/operator02.reject.out index 5d30716a..38f5992c 100644 --- a/testdata/language-features/basic-values/operator02.reject.out +++ b/testdata/language-features/basic-values/operator02.reject.out | |||
@@ -5,9 +5,9 @@ and at testdata/language-features/basic-values/operator02.reject.lc:1:3: | |||
5 | a #$# b = () | 5 | a #$# b = () |
6 | ^^^ | 6 | ^^^ |
7 | ------------ trace | 7 | ------------ trace |
8 | #$# :: forall a b . a -> b -> () | 8 | (#$#) :: forall a b . a -> b -> () |
9 | fun :: forall a . a -> () | 9 | fun :: forall a . a -> () |
10 | #$# :: forall a b . a -> b -> () | 10 | (#$#) :: forall a b . a -> b -> () |
11 | !already defined #$# at testdata/language-features/basic-values/operator02.reject.lc:3:3: | 11 | !already defined #$# at testdata/language-features/basic-values/operator02.reject.lc:3:3: |
12 | a #$# b = () | 12 | a #$# b = () |
13 | ^^^ | 13 | ^^^ |
diff --git a/testdata/language-features/basic-values/typesig06.out b/testdata/language-features/basic-values/typesig06.out index bf0f6dea..664b9dec 100644 --- a/testdata/language-features/basic-values/typesig06.out +++ b/testdata/language-features/basic-values/typesig06.out | |||
@@ -1,12 +1,12 @@ | |||
1 | ------------ desugared source code | 1 | ------------ desugared source code |
2 | funL = \(a :: _) _ -> _rhs a | 2 | funL = \(a :: _) _ -> _rhs a |
3 | <@ = \(a :: _) _ -> _rhs a | 3 | (<@) = \(a :: _) _ -> _rhs a |
4 | value1 = _rhs ("hi" <@ 1.2 :: String) | 4 | value1 = _rhs ("hi" <@ 1.2 :: String) |
5 | value2 = _rhs ("hi" `funL` 1.2 :: String) | 5 | value2 = _rhs ("hi" `funL` 1.2 :: String) |
6 | main is not found | 6 | main is not found |
7 | ------------ trace | 7 | ------------ trace |
8 | funL :: forall a b . a -> b -> a | 8 | funL :: forall a b . a -> b -> a |
9 | <@ :: forall a b . a -> b -> a | 9 | (<@) :: forall a b . a -> b -> a |
10 | value1 :: String | 10 | value1 :: String |
11 | value2 :: String | 11 | value2 :: String |
12 | ------------ tooltips | 12 | ------------ tooltips |
diff --git a/testdata/language-features/basic-values/typesig07.out b/testdata/language-features/basic-values/typesig07.out index c589424f..172e6819 100644 --- a/testdata/language-features/basic-values/typesig07.out +++ b/testdata/language-features/basic-values/typesig07.out | |||
@@ -3,7 +3,7 @@ value1 = _rhs (fromInt 1) :: Int | |||
3 | value2 = _rhs (fromInt 2) :: Int | 3 | value2 = _rhs (fromInt 2) :: Int |
4 | value3 = _rhs (fromInt 3) :: Int | 4 | value3 = _rhs (fromInt 3) :: Int |
5 | value4 = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] | 5 | value4 = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] |
6 | @@@ = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] | 6 | (@@@) = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] |
7 | value6 = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] | 7 | value6 = (\_ _ -> _rhs HNil) :: HList '[] -> HList '[] -> HList '[] |
8 | main is not found | 8 | main is not found |
9 | ------------ trace | 9 | ------------ trace |
@@ -11,7 +11,7 @@ value1 :: Int | |||
11 | value2 :: Int | 11 | value2 :: Int |
12 | value3 :: Int | 12 | value3 :: Int |
13 | value4 :: () -> () -> () | 13 | value4 :: () -> () -> () |
14 | @@@ :: () -> () -> () | 14 | (@@@) :: () -> () -> () |
15 | value6 :: () -> () -> () | 15 | value6 :: () -> () -> () |
16 | ------------ tooltips | 16 | ------------ tooltips |
17 | testdata/language-features/basic-values/typesig07.lc 1:27-1:30 | 17 | testdata/language-features/basic-values/typesig07.lc 1:27-1:30 |
diff --git a/testdata/language-features/section/section01.out b/testdata/language-features/section/section01.out index 9af1bf31..dd5e5093 100644 --- a/testdata/language-features/section/section01.out +++ b/testdata/language-features/section/section01.out | |||
@@ -1,10 +1,10 @@ | |||
1 | ------------ desugared source code | 1 | ------------ desugared source code |
2 | !@! = \_ _ -> _rhs HNil | 2 | (!@!) = \_ _ -> _rhs HNil |
3 | value1 = \(a :: _) -> _rhs \(b :: _) -> a !@! b | 3 | value1 = \(a :: _) -> _rhs \(b :: _) -> a !@! b |
4 | value2 = \(a :: _) -> _rhs \(b :: _) -> b !@! a | 4 | value2 = \(a :: _) -> _rhs \(b :: _) -> b !@! a |
5 | main is not found | 5 | main is not found |
6 | ------------ trace | 6 | ------------ trace |
7 | !@! :: forall a b . a -> b -> () | 7 | (!@!) :: forall a b . a -> b -> () |
8 | value1 :: forall a b . a -> b -> () | 8 | value1 :: forall a b . a -> b -> () |
9 | value2 :: forall a b . a -> b -> () | 9 | value2 :: forall a b . a -> b -> () |
10 | ------------ tooltips | 10 | ------------ tooltips |
diff --git a/testdata/typeclass.out b/testdata/typeclass.out index 407b8154..82487126 100644 --- a/testdata/typeclass.out +++ b/testdata/typeclass.out | |||
@@ -5,8 +5,8 @@ infix 4 < | |||
5 | infixr 3 && | 5 | infixr 3 && |
6 | infixr 2 || | 6 | infixr 2 || |
7 | not = \(a :: _) -> case'Bool (\_ -> _ :: _) (_rhs True) (_rhs False) a | 7 | not = \(a :: _) -> case'Bool (\_ -> _ :: _) (_rhs True) (_rhs False) a |
8 | && = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs False) (_rhs b) a | 8 | (&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs False) (_rhs b) a |
9 | || = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs b) (_rhs True) a | 9 | (||) = \(a :: _) (b :: _) -> case'Bool (\_ -> _ :: _) (_rhs b) (_rhs True) a |
10 | 'Eq | 10 | 'Eq |
11 | = (\(a :: _) -> match'Bool | 11 | = (\(a :: _) -> match'Bool |
12 | (\_ -> _) | 12 | (\_ -> _) |
@@ -14,7 +14,7 @@ not = \(a :: _) -> case'Bool (\_ -> _ :: _) (_rhs True) (_rhs False) a | |||
14 | a | 14 | a |
15 | (_rhs ('Empty "no instance of 'Eq on ???"))) | 15 | (_rhs ('Empty "no instance of 'Eq on ???"))) |
16 | :: Type -> Type | 16 | :: Type -> Type |
17 | == | 17 | (==) |
18 | = (\ @a @_ -> match'Bool | 18 | = (\ @a @_ -> match'Bool |
19 | (\_ -> _) | 19 | (\_ -> _) |
20 | (_rhs | 20 | (_rhs |
@@ -27,15 +27,15 @@ not = \(a :: _) -> case'Bool (\_ -> _ :: _) (_rhs True) (_rhs False) a | |||
27 | a | 27 | a |
28 | (_rhs undefined)) | 28 | (_rhs undefined)) |
29 | :: forall e . Eq e => e -> e -> Bool | 29 | :: forall e . Eq e => e -> e -> Bool |
30 | /= = \(a :: _) (b :: _) -> _rhs (not (a == b)) | 30 | (/=) = \(a :: _) (b :: _) -> _rhs (not (a == b)) |
31 | main is not found | 31 | main is not found |
32 | ------------ trace | 32 | ------------ trace |
33 | not :: Bool -> Bool | 33 | not :: Bool -> Bool |
34 | && :: Bool -> Bool -> Bool | 34 | (&&) :: Bool -> Bool -> Bool |
35 | || :: Bool -> Bool -> Bool | 35 | (||) :: Bool -> Bool -> Bool |
36 | 'Eq :: Type -> Type | 36 | 'Eq :: Type -> Type |
37 | == :: forall a . Eq a => a -> a -> Bool | 37 | (==) :: forall a . Eq a => a -> a -> Bool |
38 | /= :: forall a . Eq a => a -> a -> Bool | 38 | (/=) :: forall a . Eq a => a -> a -> Bool |
39 | ------------ tooltips | 39 | ------------ tooltips |
40 | testdata/typeclass.lc 8:1-8:4 | 40 | testdata/typeclass.lc 8:1-8:4 |
41 | Bool -> Bool | 41 | Bool -> Bool |