Skip to content

Instantly share code, notes, and snippets.

@lspitzner
Last active August 29, 2015 14:13
Show Gist options
  • Save lspitzner/a721d3b1e50b87ecf6cf to your computer and use it in GitHub Desktop.
Save lspitzner/a721d3b1e50b87ecf6cf to your computer and use it in GitHub Desktop.
bad/wrong warning by ghc?
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
data HList :: [*] -> * where
HNil :: HList '[]
(:+:) :: x -> HList xs -> HList (x ': xs)
main :: IO ()
main = do
let x :: HList '[Bool]
x = True :+: HNil
case x of
(b :+: HNil) -> print b -- Pattern match(es) are non-exhaustive ... Patterns not matched: _ :+: (_ :+: _)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment