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
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 {
View zeromq.md
git clone git://github.com/mkoppanen/php-zmq.git
cd php-zmq
phpize && ./configure
make && make install

Finally add the following line to your php.ini:

@mathiasverraes
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
<?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
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
mathiasverraes / setup.md
Created Jun 19, 2016
haskell intellij + stack setup
View setup.md

https://github.com/rikvdkleij/intellij-haskell

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;

Project

View DDDEU17.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//www.marudot.com//iCal Event Maker
X-WR-CALNAME:Domain-Driven Design Europe 2017
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
View Bowling.hs
module Bowling where
import Test.QuickCheck
import Data.List
data Frame =
Roll Int Int
| Spare Int Int
| SpareExtra Int
| Strike
View gist:839f7b9e6d882f8333b9
https://github.com/gigasquid/wonderland-clojure-katas
http://exercism.io
http://archkatas.herokuapp.com
You can’t perform that action at this time.