View TraceExample.purs
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
import Debug.Trace (trace)
f :: Int -> String
f 1 = "one"
f 2 = "two"
f _ = "meh"
View emacs-24.5-24bit.diff
This is a modified version of the patch found here:
https://gist.github.com/choppsv1/36aacdd696d505566088
Which itself is a modified version of:
http://emacs.1067599.n5.nabble.com/RFC-Add-tty-True-Color-support-tt299962.html
To use true-color, use the flag --color=true-color.
Alternatively, set the EMACS_TRUE_COLOR_SEPARATOR environment variable to
either ':' or ';'.
View Main.hs
module Main where
import Control.Applicative
import Data.Monoid
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
instance Monoid a => Monoid (ZipList a) where
mempty = pure mempty
View Main.hs
module Main where
import Control.Applicative
import Data.Monoid
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
instance Monoid a => Monoid (ZipList a) where
mempty = pure mempty
View Main.hs
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeOperators #-}
module Main where
-- | 'f ~> g' means natural transformation from a functor 'f' to a functor 'g'
type (~>) f g = forall a. f a -> g a
-- | const functor, which works as if it's just a constant
View Spec.hs
import Test.Hspec
import Test.Hspec.QuickCheck (prop)
main :: IO ()
main = hspec $ do
describe "quickcheck" $ do
prop "assoc" $ \x y z ->
x + (y + z) == ((x + y) + (z :: Double))
View sum-of-records-bottom-haskell.md

Let me guess there is a data PL as a sum type of records:

data PL = Functional { name :: String, pure :: Bool }
        | ObjectOriented { name :: String, multipleInheritance :: Bool }

The type of pure is:

View digestive-functors-tutorial.md
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
import Control.Applicative ((<$>), (<*>))
import Data.Maybe (isJust)
import Data.Text (Text)
import Text.Blaze ((!))
View rmfc.md
View code-poet.hs
timestampPath :: IO FilePath
timestampPath = ???
-- using do, more readable.
writeTimestamp :: UnixTime -> IO ()
writeTimestamp x = do
path <- timestampPath
writeFile path (encodeUnixTime x)
-- using point-free style, feeling good.