Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Agda2Lambox/Compile/Function.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE NamedFieldPuns, DataKinds, OverloadedStrings #-}
-- | Convert Agda functions to λ□ constant declarations
module Agda2Lambox.Compile.Function
module Agda2Lambox.Compile.Function
( compileFunction
) where

Expand Down Expand Up @@ -106,7 +106,10 @@ compileFunction (t :: Target t) defn@Defn{defType} = do

builder . flip LBox.LFix k <$>
forM mdefs \def@Defn{defName} -> do
body <- compileFunctionBody mnames def
body <- compileFunctionBody mnames def >>= \case
[email protected]{} -> pure l
LBox.LBox -> pure $ LBox.LLambda LBox.Anon LBox.LBox
_ -> genericError "Fixpoint body must be Lambda."
return LBox.Def
{ dName = qnameToName defName
, dBody = body
Expand Down