Skip to content

Instantly share code, notes, and snippets.

@MedeaMelana
MedeaMelana / TargetList.hs
Created August 11, 2012 11:55
Data type and utility functions for objects on the stack in a Magic: The Gathering game
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
module TargetList where
import Prelude hiding (length)
import Control.Applicative
@MedeaMelana
MedeaMelana / Parser.hs
Created July 7, 2011 22:19
101companies parser using Parsec
-- By Martijn van Steenbergen
-- 7 July 3022, 23h00
-- GTTSE 2011, Braga, Portugal
module Parser where
import Company
import Control.Applicative hiding (many, (<|>))
import Text.Parsec
@MedeaMelana
MedeaMelana / Xopus.hs
Created July 5, 2011 15:09
The Xopus Challenge
-- Solution to https://twitter.com/xopus/status/88187651705946112
module Xopus where
import Data.List
import Control.Arrow
-- Prints:
-- Sub (Mul (Num 12) (Add (Num 6) (Mul (Num 3) (Num 9)))) (Num 15)
-- Sub (Mul (Num 12) (Add (Num 6) (Mul (Num 9) (Num 3)))) (Num 15)
main :: IO ()