Compiles again.
parent
089ba00c58
commit
df11d8e7aa
|
@ -10,7 +10,7 @@ import Data.Codec.Argonaut as CA
|
|||
import Data.Maybe
|
||||
import Data.Either
|
||||
import Data.Codec.Argonaut.Record as CAR
|
||||
import Data.UInt (fromInt, UInt)
|
||||
import Data.UInt (fromInt, toInt, UInt)
|
||||
|
||||
import Data.Tuple (Tuple(..))
|
||||
import Data.ArrayBuffer.ArrayBuffer as ArrayBuffer
|
||||
|
@ -180,9 +180,10 @@ serialize request
|
|||
deserialize :: ArrayBuffer -> Effect (Either DecodeError AnswerMessage)
|
||||
deserialize arraybuffer
|
||||
= do
|
||||
case (IPC.fromTypedIPC arraybuffer) of
|
||||
value <- liftEffect $ IPC.fromTypedIPC arraybuffer
|
||||
pure $ case (value) of
|
||||
Left err -> Left (UnknownError $ show err)
|
||||
Right (Tuple messageTypeNumber string) -> case (decode messageTypeNumber $ J.fromString string) of
|
||||
Right (Tuple messageTypeNumber string) -> case (decode (toInt messageTypeNumber) $ J.fromString string) of
|
||||
Left parsingError -> Left parsingError
|
||||
Right answerMessage -> Right answerMessage
|
||||
|
||||
|
|
Loading…
Reference in New Issue