Skip to content

Instantly share code, notes, and snippets.

@totem3
totem3 / file.md
Last active August 29, 2015 14:26 — forked from gakuzzzz/file.md
UserId など値型はどうするべきか

UserId などの型はどうするべきか

1. primitive 型をそのまま使う

case class Person(id: Long, name: String, organizationId: Long)
object Person {

  def groupByOrg: Map[Long, Seq[Person]] = ...
{-# LANGUAGE GADTs #-}
module Main where
import Control.Monad
import Control.Monad.RWS.Strict
import Control.Monad.Trans.Error
import Control.Monad.Operational.Simple
import Prelude hiding (putChar, getChar)
import qualified System.IO as IO
(use 'clojure.core.logic)
(defne append [x y z]
([() a a])
([[a . b] _ [a . c]]
(append b y c)))
@totem3
totem3 / TypeClass.hs
Created November 30, 2012 14:26 — forked from xuwei-k/TypeClass.hs
Type-class hierarchy
{-# LANGUAGE NoImplicitPrelude, MultiParamTypeClasses, Rank2Types, TypeOperators #-}
newtype Id a =
Id a
data a :\/ b =
Left a
| Right b
data a :/\ b =