[Home]DojoDeveloppement/Mercredi6Juin2012

AgileFrance | DojoDeveloppement | DernieresNouvelles | Preferences | AideEnLigne

Participants :

Rétrospective de la session du /Mercredi30Mai2012 :

Sujets pour ce soir :


Le code de la soirée :
Tests.hs
{-#LANGUAGE TypeSynonymInstances#-}
{-#LANGUAGE FlexibleInstances#-}
module Tests where
import Test.HUnit

class Moche t where
  make :: t

instance Moche String where
  make = "x"

instance Moche (String->String) where
  make = (\x->x)

printf :: Moche r => String -> r
printf "x" = make
printf "%s" = make

main = runTestTT $ TestList [
    printf "x" ~?= "x",
    printf "%s" "y" ~?= "y",
    printf "%s" "z" ~?= "z",
    printf "%s" ~?= "x"
  ]

AgileFrance | DojoDeveloppement | DernieresNouvelles | Preferences | AideEnLigne
Edit this page | View other revisions
Last edited June 6, 2012 8:46 pm (diff)
Search: