Created
September 8, 2015 16:36
-
-
Save afonsomatos/4308674d5eacc0a457ac to your computer and use it in GitHub Desktop.
OverloadedStrings example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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