@@ -10,7 +10,6 @@ import SourceSyntax.Expression (LExpr)
10import SourceSyntax.Declaration
10import SourceSyntax.Declaration
11import SourceSyntax.Type
11import SourceSyntax.Type
12import System.FilePath (joinPath)
12import System.FilePath (joinPath)
13−import Control.Monad (liftM)
15import qualified Elm.Internal.Version as Version
14import qualified Elm.Internal.Version as Version
@@ -25,20 +24,18 @@ data ImportMethod = As String | Importing [String] | Hiding [String]
25 deriving (Eq, Ord, Show)
24 deriving (Eq, Ord, Show)
27instance Binary ImportMethod where
26instance Binary ImportMethod where
28+ let put' n info = putWord8 n >> put info in
28− put (As s) = do put (0 :: Word8)
30+ As s -> put' 0 s
31− put (Importing ss) = do put (1 :: Word8)
31+ Importing ss -> put' 1 ss
34− put (Hiding ss) = do put (2 :: Word8)
32+ Hiding ss -> put' 2 ss
37 get = do tag <- getWord8
34 get = do tag <- getWord8
38 case tag of
35 case tag of
39− 0 -> liftM As get
36+ 0 -> As <$> get
40− 1 -> liftM Importing get
37+ 1 -> Importing <$> get
41− 2 -> liftM Hiding get
38+ 2 -> Hiding <$> get
42 _ -> error "Error reading valid ImportMethod type from serialized string"
39 _ -> error "Error reading valid ImportMethod type from serialized string"
44data MetadataModule t v = MetadataModule {
41data MetadataModule t v = MetadataModule {