Skip to content

Instantly share code, notes, and snippets.

View taras2k's full-sized avatar

Taras taras2k

View GitHub Profile
@taras2k
taras2k / exLog.hs
Created March 7, 2018 13:08
ch24 - Log parser - exercise 5
{-# LANGUAGE QuasiQuotes #-}
module Exlog where
import Control.Applicative
import Control.Monad (unless, void)
import Data.Char (isSpace)
import Data.List (dropWhile, dropWhileEnd)
import qualified Data.Map.Strict as M
import Data.Time
@taras2k
taras2k / funct.hs
Last active December 27, 2017 03:50
haskell-book chapter16 exersizes
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
module Funct where
import Data.Data
-- import Data.Typeable
import Test.QuickCheck
import Test.QuickCheck.Function
@taras2k
taras2k / phone.hs
Last active December 5, 2017 19:53
phone from haskell book
module Phone where
import Data.Char (isLetter, isUpper, toLower, toUpper)
import Data.List (elemIndex, elemIndices, find, nub, sortBy)
import Data.Maybe (fromMaybe)
import Data.Tuple (swap)
phone :: [(Char, String)]
phone =
[ ('0', " +_0")