This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Nel where | |
| import Control.Comonad | |
| infixr 5 :| | |
| data Nel a = a :| [a] | |
| toList :: Nel a -> [a] | |
| toList (a :| as) = a : as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} | |
| import Data.Distributive | |
| class (Functor a, Functor b) => Bidistributive a b where | |
| dist :: a (b c) -> b (a c) | |
| tsid :: b (a c) -> a (b c) | |
| instance (Distributive x, Distributive y) => Bidistributive x y where | |
| dist = distribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| infixl 4 -*-, -$- | |
| class Fundipitive f where | |
| (-*-) :: f (a -> b) -> f a -> f b | |
| (-$-) :: (a -> b) -> f a -> f b | |
| liftFd2 :: | |
| Fundipitive f => | |
| (a -> b -> r) | |
| -> f a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Stepper v = StepperImpl v s | |
| data StepperImpl v s = StepperImpl { | |
| initial :: s, | |
| next :: s -> (v -> s -> StepState v s) -> StepState v s -> StepState v s | |
| } | |
| data StepState v s = More v s | Done | |
| step1 :: StepperImpl v s -> StepState v s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return | |
| loggedUnit("Initializing thesaurus from file: " + zipFile) | |
| .anonBindStrict(setLicense()) | |
| .anonBind(loadFromZipF(zipFile)) | |
| .appendLogIfNone("Unable to intialise Thesaurus."); |
NewerOlder