Skip to content

Commit

Permalink
Add a couple doc comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Grant Jeffries committed Nov 5, 2019
1 parent 1e123d3 commit 88cd380
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bowtie/src/Bowtie/Core/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ import qualified Data.Set as Set

data Expr
= Var Id
| Lam Id Type Expr
| Lam Id Type Expr -- ^ @Type@ is the type of the argument, not the @Expr@
| App Expr Expr

| Let (HashMap Id (Expr, Type)) Expr

| Construct Id
| Construct Id -- ^ E.g. @Just@
| Case Expr [Alt]

| PrimInt Integer
| PrimOp Operation
deriving (Eq, Show)

-- | For example:
--
-- > Just x -> plus x 1
--
-- is represented as:
--
-- > Alt
-- > (Id "Just")
-- > [Id "x"]
-- > (PrimOp (Plus (Id "x") (PrimInt 1)))
data Alt
= Alt Id [Id] Expr
deriving (Eq, Show)
Expand Down

0 comments on commit 88cd380

Please sign in to comment.