Remove absurd

This commit is contained in:
Gabriel Gonzalez 2016-10-16 08:34:43 -07:00
parent dc3b0fcf66
commit 8b94bf4189
3 changed files with 0 additions and 14 deletions

View File

@ -261,8 +261,6 @@ data Expr a
| Union (Map Text (Expr a))
-- | > UnionLit (k1, v1) [(k2, t2), (k3, t3)] ~ < k1 = t1, k2 : t2, k3 : t3 >
| UnionLit Text (Expr a) (Map Text (Expr a))
-- | > Absurd ~ absurd
| Absurd
-- | > Field e x ~ e.x
| Field (Expr a) Text
-- | > Embed path ~ path
@ -326,7 +324,6 @@ instance Monad Expr where
RecordLit kvs >>= k = RecordLit (fmap (>>= k) kvs)
Union kts >>= k = Union (fmap (>>= k) kts)
UnionLit k' v kts >>= k = UnionLit k' (v >>= k) (fmap (>>= k) kts)
Absurd >>= _ = Absurd
Field r x >>= k = Field (r >>= k) x
Embed r >>= k = k r
@ -538,8 +535,6 @@ buildExpr6 (Union a) =
buildUnion a
buildExpr6 (UnionLit a b c) =
buildUnionLit a b c
buildExpr6 Absurd =
"absurd"
buildExpr6 (Embed a) =
build a
buildExpr6 (Field a b) =
@ -1812,8 +1807,6 @@ typeWith ctx e@(UnionLit k v kts) = do
Nothing -> return ()
t <- typeWith ctx v
return (Union (Data.Map.insert k t kts))
typeWith _ Absurd = do
return (Pi "_" (Union Data.Map.empty) (Pi "a" (Const Type) "a"))
typeWith ctx e@(Field r x ) = do
t <- fmap normalize (typeWith ctx r)
case t of

View File

@ -108,7 +108,6 @@ tokens :-
"List/reverse" { emit ListReverse }
"Maybe" { emit Maybe }
"Maybe/fold" { emit MaybeFold }
"absurd" { emit Absurd }
\" ([^\"] | \\.)* \" { capture (TextLit . str) }
$fst $labelchar* | "(" $opchar+ ")" { capture (Label . toText) }
\-? $digit+ { capture (Number . toInt) }
@ -276,7 +275,6 @@ data Token
| Maybe
| MaybeFold
| TextLit Builder
| Absurd
| Label Text
| Number Integer
| File FilePath
@ -397,8 +395,6 @@ instance Buildable Token where
= "Maybe/fold"
build (TextLit t)
= Data.Text.Buildable.build (show t)
build Absurd
= "absurd"
build (Label t)
= Data.Text.Buildable.build t
build (Number n)

View File

@ -93,7 +93,6 @@ import qualified NeatInterpolation
'List/reverse' { Dhall.Lexer.ListReverse }
'Maybe' { Dhall.Lexer.Maybe }
'Maybe/fold' { Dhall.Lexer.MaybeFold }
'absurd' { Dhall.Lexer.Absurd }
text { Dhall.Lexer.TextLit $$ }
label { Dhall.Lexer.Label $$ }
number { Dhall.Lexer.Number $$ }
@ -241,8 +240,6 @@ Expr6
{ $1 }
| UnionLit
{ $1 }
| 'absurd'
{ Absurd }
| Import
{ Embed $1 }
| Expr6 '.' label