summaryrefslogtreecommitdiff
path: root/com/simatime/network.hs
diff options
context:
space:
mode:
Diffstat (limited to 'com/simatime/network.hs')
-rw-r--r--com/simatime/network.hs31
1 files changed, 0 insertions, 31 deletions
diff --git a/com/simatime/network.hs b/com/simatime/network.hs
deleted file mode 100644
index e47e891..0000000
--- a/com/simatime/network.hs
+++ /dev/null
@@ -1,31 +0,0 @@
--- | A port of Kris Jenkins' RemoteData Elm module
--- <https://github.com/krisajenkins/remotedata>.
---
-module Com.Simatime.Network where
-
-data RemoteData a b
- = NotAsked
- | Loading
- | Failure a
- | Success b
- deriving (Eq, Show)
-
--- TODO figure out Http.Error
--- type WebData a = RemoteData Http.Error a
-
-instance Functor (RemoteData a) where
- fmap _ NotAsked = NotAsked
- fmap _ Loading = Loading
- fmap _ (Failure a) = Failure a
- fmap f (Success a) = Success (f a)
-
-instance Applicative (RemoteData e) where
- pure = Success
- NotAsked <*> _ = NotAsked
- Loading <*> _ = Loading
- Failure a <*> _ = Failure a
- Success a <*> b = fmap a b
-
-fromEither :: Either a b -> RemoteData a b
-fromEither (Left a) = Failure a
-fromEither (Right a) = Success a