packages feed

elision 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+11/−6 lines, 3 files

Files

elision.cabal view
@@ -1,5 +1,5 @@ name:                elision-version:             0.1.0.1+version:             0.1.0.2 synopsis:            A data structure over two functions to be linked together at a later time. homepage:            http://github.com/crough/elision#readme license:             BSD2
example/Main.hs view
@@ -75,16 +75,16 @@ -------------------------------------------------------------------------------- getCredentials :: Elision Tty () (User,Pass) getCredentials =-  do putLine <~ "Enter your username (blank if guest)"+  do putLine `apply` "Enter your username (blank if guest)"      user    <- readLine-     putLine <~ "Enter your password"+     putLine `apply` "Enter your password"      pass    <- readLine      pure (user,pass) -interactiveAuth :: Elision (Tty // Auth) () AuthLevel+interactiveAuth :: Elision (Auth // Tty) () AuthLevel interactiveAuth = anyAccess </ getCredentials  main :: IO () main =-  do auth <- complete' (ttyIO // authIO) interactiveAuth+  do auth <- complete' (authIO // ttyIO) interactiveAuth      print auth
src/Control/Arrow/Elision.hs view
@@ -35,12 +35,13 @@          -- * Reexports        , module Control.Arrow        , module Data.Profunctor+       , apply        )        where  import Control.Applicative (Applicative (..)) import Control.Arrow       (Arrow (..), ArrowApply (..), ArrowChoice (..),-                            ArrowMonad, second, (&&&), (***), (+++), (<<<),+                            ArrowMonad, second, right, (&&&), (***), (+++), (<<<),                             (<<^), (>>>), (>>^), (^<<), (^>>), (|||)) import Control.Category    (Category (..)) import Control.Monad       (Functor (..), Monad (..), (=<<))@@ -165,3 +166,7 @@ -- types together. (</) :: Elision f b c -> Elision g a b -> Elision (f // g) a c b </ a = left' b . right' a++apply :: ArrowApply a => a b c -> b -> a () c+apply arrow arg =+  app <<^ const (arrow, arg)