Skip to content

Instantly share code, notes, and snippets.

Mathias Verraes mathiasverraes

Block or report user

Report or block mathiasverraes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mathiasverraes / MonoidalFizzBuzz.hs
Created Nov 16, 2016
Extensible Monoidal FizzBuzz in Haskell
View MonoidalFizzBuzz.hs
module MonoidalFizzBuzz where
import Data.Monoid
import Data.Maybe
-- based on @mittie
monoidalFizzbuzz = zipWith fromMaybe numbers strings
fizzes = cycle [Nothing, Nothing, Just "Fizz"]
buzzes = cycle [Nothing, Nothing, Nothing, Nothing, Just "Buzz"]
mathiasverraes / Workflow.hs
Created Aug 16, 2016
haskell (publishing) workflow experiment
View Workflow.hs
module Workflow where
import Data.Maybe
import Data.Set
newtype State = State String deriving(Ord, Show, Eq)
type States = Set State
data Action = Action String deriving(Eq, Show)
type Workflow = [Transition]
data Transition = Transition {
git clone git://
cd php-zmq
phpize && ./configure
make && make install

Finally add the following line to your php.ini:

mathiasverraes / Maze.hs
Last active Aug 4, 2016
initial PoC for a maze game in Haskell
View Maze.hs
module Lib where
import Data.List.Split
import System.Random
a4by4Maze :: Maze
a4by4Maze = Maze [
View LeSighTest.php
final class FuckYouPHPTest extends \PHPUnit_Framework_TestCase {
/** @test */
public function should_fail () {
new WantsAString(new NotAString());
// Fails as expected
/** @test */
View Beauforma.hs
{-# LANGUAGE ExistentialQuantification #-}
module Beauforma where
import qualified Data.Map.Strict as M
data Event =
GuestBookedAppointment {
appointmentId :: Guid,
guestId :: GuestId,
appointmentDateAndTime :: DateTime,
mathiasverraes / Money.hs
Last active Jun 21, 2016
fooling around with haskell types and money
View Money.hs
{-# LANGUAGE ExistentialQuantification #-}
module Money where
data Money a = Currency a => Money {currency :: a, amount :: Float}
instance Show (Money a) where
show (Money c a) = show c ++ " " ++ show a
instance Eq (Money a) where
(Money cx x) == (Money cy y) = cx == cy && x == y
class (Eq a, Show a) => Currency a where symbol :: a
data EUR = EUR deriving (Show, Eq)
mathiasverraes /
Created Jun 19, 2016
haskell intellij + stack setup

General setup

  • Install latest versions of ghc-mod and haskell-docs;
  • Set file paths to ghc-mod, hlint, stack and haskell-docs in the menu Settings/Other Settings/Haskell.
  • Be sure in Editor/Filetypes that Haskell language file is registered with pattern *.hs and Literate Haskell language file with pattern *.lhs;


View DDDEU17.ics
PRODID:-// Event Maker
X-WR-CALNAME:Domain-Driven Design Europe 2017
View Bowling.hs
module Bowling where
import Test.QuickCheck
import Data.List
data Frame =
Roll Int Int
| Spare Int Int
| SpareExtra Int
| Strike
You can’t perform that action at this time.