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
| import Control.Applicative | |
| import Control.Monad | |
| import Data.Char | |
| import Data.List.Split | |
| import Data.SBV | |
| main :: IO () | |
| main = do | |
| t <- map read . words <$> getLine | |
| case t of |
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 Foo ( | |
| module Bar, | |
| module Baz, | |
| ... | |
| ) where | |
| import Bar | |
| import Baz | |
| ... |
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 DeriveGeneric #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| import Control.Lens hiding (Rep, from, to) |
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 DeriveFunctor, TypeFamilies, EmptyDataDecls, PolyKinds, DataKinds, ConstraintKinds #-} | |
| newtype Dimensional (dim :: Dimension) a = Dimensional a | |
| deriving (Eq, Ord, Show, Functor) | |
| data Dimension = Dim0 | Dim String Int Dimension | |
| type family Insert (a :: Dimension) (k :: String) (v :: Int) :: Dimension | |
| type instance Insert (Dim0 k v) = Dim k v Dim0 | |
| type instance (k < a) => Insert (Dim a b l) k v = Dim k v (Dim a b l) |
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
| mylist :: Int -> [[Int]] | |
| mylist n = take n $ iterate (map (+n)) [1..n] | |
| main :: IO () | |
| main = print.last.last $ map reverse $ mylist 4000 |
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
| -- Initial iconv-conduit.cabal generated by cabal init. For further | |
| -- documentation, see http://haskell.org/cabal/users-guide/ | |
| name: iconv-conduit | |
| version: 0.1.0.0 | |
| -- synopsis: | |
| -- description: | |
| license: BSD3 | |
| license-file: LICENSE | |
| author: Hideyuki Tanaka |
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
| import Control.Category | |
| import Prelude hiding (id, (.)) | |
| data Lens a b | |
| = Lens | |
| { get :: a -> b | |
| , set :: b -> a -> 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
| import Control.Lens | |
| import Control.Monad | |
| import Control.Monad.State | |
| import Data.List | |
| import qualified Data.Map as M | |
| paint :: M.Map (Int, Int) Char -> (Int, Int) -> Int | |
| paint mm pos = evalState (go pos) mm where | |
| go (i, j) = do | |
| b <- use $ at (i, j) |
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 DeriveDataTypeable #-} | |
| import Data.Binary as B | |
| import Data.Binary.Shared as S | |
| import qualified Data.ByteString.Lazy as L | |
| import Data.Typeable | |
| import Data.List | |
| import System.Random | |
| import Control.Monad |
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 OverloadedStrings #-} | |
| import Control.Applicative | |
| import Control.Concurrent (threadDelay) | |
| import Control.Concurrent.Async (async, race_, wait) | |
| import Control.Monad | |
| import qualified Data.ByteString as S | |
| import Data.ByteString.Char8 () | |
| import Data.Conduit | |
| import Data.Conduit.Network |