Last active
August 29, 2015 14:13
-
-
Save lspitzner/a721d3b1e50b87ecf6cf to your computer and use it in GitHub Desktop.
bad/wrong warning by ghc?
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 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