This file contains 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 TemplateHaskell #-} | |
import Pipes | |
import qualified Pipes.Prelude as P | |
import MVC | |
import MVC.Prelude | |
import Control.Lens | |
data V = Twice Int | Thrice Int | |
makePrisms ''V |
This file contains 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 DeriveFunctor, FlexibleInstances #-} | |
{-# OPTIONS -Wall #-} | |
import Control.Monad.Free | |
import Control.Applicative | |
data SomeF f a = Many [a] | One (f a) deriving Functor | |
instance Functor f => Alternative (Free (SomeF f)) where | |
empty = Free (Many []) |