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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TupleSections #-} | |
module Bowling (score, BowlingError(..)) where | |
import Control.Applicative (Applicative (..)) | |
import Control.Monad | |
import Control.Monad.State (MonadState (get, put), MonadTrans (lift), | |
StateT, runStateT) | |
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
#! /usr/bin/env nix-shell | |
#! nix-shell -p "pkgs.haskell.packages.ghc925.ghcWithPackages (p: [p.free])" | |
#! nix-shell -i "runhaskell" | |
import Control.Monad.Free (Free (..), liftF) | |
-- DSLのInterfaceを定義 | |
data CalcF a | |
= Add Int a |