Skip to content

Instantly share code, notes, and snippets.

@Sophia-Gold
Created April 16, 2018 04:29
Show Gist options
  • Select an option

  • Save Sophia-Gold/6ca8e336e27540060a058a2d4efe5fb3 to your computer and use it in GitHub Desktop.

Select an option

Save Sophia-Gold/6ca8e336e27540060a058a2d4efe5fb3 to your computer and use it in GitHub Desktop.
Power Serious using -XOverloadedLists
{-# LANGUAGE OverloadedLists #-}
import GHC.Exts
newtype PowS' a = PowS' { fromPowS :: [a] }
instance IsList (PowS' a) where
type (Item (PowS' a)) = a
fromList a = PowS' a
toList a = fromPowS a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment