From c790672cc244ac4caba1bda3572829a6c6862891 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 27 Oct 2019 09:48:52 -0700 Subject: move everything to namespace directories --- lore/Network/RemoteData.hs | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 lore/Network/RemoteData.hs (limited to 'lore/Network/RemoteData.hs') diff --git a/lore/Network/RemoteData.hs b/lore/Network/RemoteData.hs deleted file mode 100644 index 2fe6557..0000000 --- a/lore/Network/RemoteData.hs +++ /dev/null @@ -1,31 +0,0 @@ --- | A port of Kris Jenkins' RemoteData Elm module --- . --- -module Network.RemoteData 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 -- cgit v1.2.3