@@ -19,6 +19,7 @@ module Elm.Package
22+import Control.Monad (liftM, liftM2, liftM3)
22import Data.Binary (Binary, get, getWord8, put, putWord8)
23import Data.Binary (Binary, get, getWord8, put, putWord8)
23import qualified Data.Char as Char
24import qualified Data.Char as Char
24import Data.Function (on)
25import Data.Function (on)
@@ -223,7 +224,7 @@ toNumber txt =
224instance Binary Name where
225instance Binary Name where
226− Name <$> get <*> get
227+ liftM2 Name get get
228 put (Name user project) =
229 put (Name user project) =
229 do put user
230 do put user
@@ -232,7 +233,7 @@ instance Binary Name where
233instance Binary Package where
234instance Binary Package where
235− Package <$> get <*> get
236+ liftM2 Package get get
237 put (Package name version) =
238 put (Package name version) =
238 do put name
239 do put name
@@ -243,10 +244,10 @@ instance Binary Version where
244 do word <- getWord8
245 do word <- getWord8
245 if word == 0
246 if word == 0
246− then Version <$> get <*> get <*> get
247+ then liftM3 Version get get get
248− do minor <- fromIntegral <$> getWord8
249+ do minor <- liftM fromIntegral getWord8
249− patch <- fromIntegral <$> getWord8
250+ patch <- liftM fromIntegral getWord8
250 return (Version (fromIntegral word) minor patch)
251 return (Version (fromIntegral word) minor patch)
252 put (Version major minor patch) =
253 put (Version major minor patch) =