Skip to content

Instantly share code, notes, and snippets.

@kfish
kfish / FieldNames.hs
Created November 15, 2012 02:49
Data constructor field names as [String] using Template Haskell
{-# LANGUAGE TemplateHaskell #-}
module FieldNames (
fieldNames
) where
import Data.List (nub)
import Language.Haskell.TH
-- | Generate a list of all field names used in the constructors
@kfish
kfish / EuphoriaTutorial.hs
Created September 15, 2012 12:23 — forked from maoe/EuphoriaTutorial.hs
elereaのチュートリアルをeuphoriaで
module Main where
import Control.Arrow
import Control.Applicative
import Control.Monad
import Data.Maybe
import FRP.Euphoria.Collection
import FRP.Euphoria.Event
import FRP.Euphoria.Signal
@kfish
kfish / watch-read.hs
Created February 15, 2011 02:01
Haskell inotify example: monitor file modifications
{-# OPTIONS -Wall #-}
module Main where
import Control.Concurrent (threadDelay)
import System.Environment (getArgs)
import System.INotify
main :: IO ()
main = do