Skip to content

ANF Core

Hécate Moonlight edited this page Feb 9, 2024 · 1 revision

Appearance

For the following code:

-- Boreal
module Mod where

main = 42 + 1 + 1 - 1

We get this representation

Module
    { moduleName = "Mod"
    , topLevelDeclarations =
        [ AFun "main" []
            ( ALet "prim_add0"
                ( Complex
                    ( AApp "+"
                        [ ALiteral 42
                        , ALiteral 1
                        ]
                    )
                )
                ( ALet "prim_sub1"
                    ( Complex
                        ( AApp "-"
                            [ ALiteral 1
                            , ALiteral 1
                            ]
                        )
                    )
                    ( Halt
                        ( Complex
                            ( AApp "+"
                                [ AVar "prim_add0"
                                , AVar "prim_sub1"
                                ]
                            )
                        )
                    )
                )
            )
        ]
    }
Clone this wiki locally