Skip to content

Instantly share code, notes, and snippets.

@afonsomatos
Created September 8, 2015 16:36
Show Gist options
  • Save afonsomatos/4308674d5eacc0a457ac to your computer and use it in GitHub Desktop.
Save afonsomatos/4308674d5eacc0a457ac to your computer and use it in GitHub Desktop.
OverloadedStrings example
{-# LANGUAGE OverloadedStrings #-}
import GHC.Exts ( IsString(..) )
newtype Vowels = Vowels String deriving Show
instance IsString Vowels where
fromString = Vowels . filter (`elem` "aeiou")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment