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 TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
import GHC.TypeLits | |
import Data.Proxy | |
type family Last (a :: (Nat -> *)) :: Nat |
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 OverloadedLists #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Map | |
import Data.Text | |
main :: IO () | |
main = do | |
let m = [("foo", 1), ("bar", 2)] | |
:: Map Text Int |
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
Feature: Compute factorial | |
In order to play with Lettuce | |
As beginners | |
We'll implement factorial | |
Scenario: Backup at certain times | |
Given I have the time 18:00 | |
Then I run server sync at "5:00" | |
Scenario: Backup at certain times |
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
Feature: Compute factorial | |
In order to play with Lettuce | |
As beginners | |
We'll implement factorial | |
Scenario: Backup at certain times | |
Given I have the time 18:00 | |
Then I run server sync | |
Then I run server sync at 5:00 |
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
(defun my-ido-find-tag () | |
"Find a tag using ido" | |
(interactive) | |
(tags-completion-table) | |
(let (tag-names) | |
(mapatoms (lambda (x) | |
(push (prin1-to-string x t) tag-names)) | |
tags-completion-table) | |
(etags-select-find (ido-completing-read "Tag: " tag-names nil nil | |
(thing-at-point 'word))))) |
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
Feature: Compute factorial | |
In order to play with Lettuce | |
As beginners | |
We'll implement factorial | |
Scenario: Backup at certain times | |
Given I have the time 18:00 | |
Then I run server sync | |
Then I run server sync at 5:00 |
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
(defun my-ido-find-tag () | |
"Find a tag using ido" | |
(interactive) | |
(tags-completion-table) | |
(let (tag-names) | |
(mapatoms (lambda (x) | |
(push (prin1-to-string x t) tag-names)) | |
tags-completion-table) | |
(etags-select-find (ido-completing-read "Tag: " tag-names nil nil | |
(thing-at-point 'word))))) |
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 OverloadedStrings, TemplateHaskell #-} | |
{-# OPTIONS_GHC -F -pgmFderive -optF-F #-} | |
import Control.Applicative | |
import Test.QuickCheck | |
import Test.QuickCheck (Positive(..)) | |
import Test.QuickCheck.Gen (unGen) | |
import Data.Text (Text) | |
import Data.String (fromString, IsString) |
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 #-} | |
import Control.Applicative | |
import Control.Monad | |
import Control.Monad.Reader | |
import Control.Monad.Maybe | |
import Control.Monad.CatchIO hiding (Handler) | |
import Control.Monad.Trans | |
import Prelude hiding (catch) |
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
import Test.Hspec (Spec, hspec) | |
import Test.Hspec.Core (SpecTree (..), fromSpecList, runSpecM) | |
addSetUp :: IO () -> Spec -> Spec | |
addSetUp action spec = fromSpecList $ (map addActionToSpecItem (runSpecM spec)) | |
where addActionToSpecItem :: SpecTree -> SpecTree | |
addActionToSpecItem (SpecGroup s l) = SpecGroup s (map addActionToSpecItem l) | |
addActionToSpecItem (SpecItem s f) = SpecItem s (\params -> (action >> (f params))) | |
printStuff :: IO () |