Created
February 14, 2014 08:48
-
-
Save ahammar/8997802 to your computer and use it in GitHub Desktop.
Mutually recursive modules using a .hs-boot file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Object where | |
import Array | |
data Value = | |
VInt Integer | |
| VArray Array | |
| VNil | VFalse | VTrue | |
| VError String | |
vnil :: Value | |
vnil = VNil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Object where | |
data Value | |
vnil :: Value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Hammer. I blew it. I had added
vnil
toObject.hs-boot~
by mistake. (Tab completion at its worst) I appreciate your time.