Skip to content

Instantly share code, notes, and snippets.

@ahammar
Created February 14, 2014 08:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahammar/8997802 to your computer and use it in GitHub Desktop.
Save ahammar/8997802 to your computer and use it in GitHub Desktop.
Mutually recursive modules using a .hs-boot file
module Array where
import qualified Data.IntMap as M
import {-# SOURCE #-} Object
data Array = Array
{ _map :: M.IntMap Value
}
a ! i {- | i >= baseLength ai -} = maybe vnil id $ M.lookup i (_map a)
module Object where
import Array
data Value =
VInt Integer
| VArray Array
| VNil | VFalse | VTrue
| VError String
vnil :: Value
vnil = VNil
module Object where
data Value
vnil :: Value
@antarestrader
Copy link

Thanks Hammer. I blew it. I had added vnil to Object.hs-boot~ by mistake. (Tab completion at its worst) I appreciate your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment