Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Aug 2, 2022
1 parent 7425bfa commit 293ce7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/Juvix/Core/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

module Juvix.Core.Language
( module Juvix.Core.Language,
module Juvix.Core.Language.Builtins,
module Juvix.Core.Language.Base,
)
where
Expand All @@ -15,23 +14,10 @@ where
-}

import Juvix.Core.Language.Base
import Juvix.Core.Language.Builtins

{---------------------------------------------------------------------------------}
{- Program tree datatype -}

-- Consecutive symbol IDs for reachable user functions.
type Symbol = Word

-- Tag of a constructor, uniquely identifying it. Tag values are consecutive and
-- separate from symbol IDs. We might need fixed special tags in Core for common
-- "builtin" constructors, e.g., unit, nat, lists, pairs, so that the code
-- generator can treat them specially.
data Tag = BuiltinTag BuiltinDataTag | UserTag Word
deriving stock (Eq, Generic)

instance Hashable Tag

-- de Bruijn index
type Index = Int

Expand Down
16 changes: 15 additions & 1 deletion src/Juvix/Core/Language/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@ module Juvix.Core.Language.Base
( Info,
Key,
IsInfo,
module Juvix.Core.Language.Base,
module Juvix.Core.Language.Builtins,
module Juvix.Prelude,
module Juvix.Prelude.Loc,
module Juvix.Syntax.Abstract.Name,
Location,
)
where

import Juvix.Core.Language.Builtins
import Juvix.Core.Language.Info (Info, IsInfo, Key)
import Juvix.Prelude
import Juvix.Prelude.Loc
import Juvix.Syntax.Abstract.Name

type Location = Interval

-- Consecutive symbol IDs for reachable user functions.
type Symbol = Word

-- Tag of a constructor, uniquely identifying it. Tag values are consecutive and
-- separate from symbol IDs. We might need fixed special tags in Core for common
-- "builtin" constructors, e.g., unit, nat, lists, pairs, so that the code
-- generator can treat them specially.
data Tag = BuiltinTag BuiltinDataTag | UserTag Word
deriving stock (Eq, Generic)

instance Hashable Tag

0 comments on commit 293ce7e

Please sign in to comment.