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
-- | ユーザー(図書館利用者) | |
data User = User | |
{ uId :: !Integer | |
, uName :: !Text | |
} deriving (Eq, Show) | |
-- | 本 | |
data Book = Book | |
{ bId :: !Integer | |
, bAuthor :: !Text |
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 EmptyCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module Reddit where | |
import Control.Monad (forM_, join) | |
import Data.Maybe (isJust) | |
import Data.Semigroup ((<>)) | |
import Data.String (fromString) |
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 Lib | |
( montyHall | |
, runMontyHall | |
) where | |
import Control.Monad (replicateM) | |
import Data.Semigroup ((<>)) | |
import System.Random (randomRIO) | |
-- | Given an list, picks an element |
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 Main where | |
import Codec.Archive.Zip | |
import Control.Monad (forM_) | |
import qualified Data.ByteString as BS | |
import qualified Data.Map.Strict as M | |
import Data.Text (Text) | |
import Data.Text.Encoding (decodeUtf8With) | |
import Data.Text.Encoding.Error (ignore) | |
import qualified Data.Text.IO as T |
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 CLI | |
( CLI(..) | |
, getCliArgs | |
) where | |
import Data.Semigroup ((<>)) | |
import Options.Applicative (Parser, argument, auto, command, execParser, fullDesc, header, | |
help, helper, info, infoOption, long, metavar, progDesc, | |
strOption, subparser, (<**>)) | |
import Paths_log_classifier (version) |
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 Main where | |
import Data.Semigroup ((<>)) | |
import Options.Applicative | |
import Paths_opt_parse (version) | |
data CLI | |
= CollectEmails | |
| ProcessTicket Int |
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
newtype App a = App (StateT UTXOs (ExcepT String Identity) a) | |
deriving (Functor, | |
, Applicative, | |
, Monad, | |
, MonadState UTXOs | |
, MonadError String) |
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
someFun :: Env -> IO () | |
... | |
someHandling :: Env -> Int -> IO Int | |
... |
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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Interpreter where | |
import Control.Monad.Except | |
import Control.Monad.State | |
import Data.Map | |
import qualified Data.Map as M |
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 TypeOperators #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module Main where | |
import GHC.Generics |