Skip to content

Instantly share code, notes, and snippets.

Created Jun 22, 2018
What would you like to do?
[jkoppel@MacBook-Pro-5:gadt_failed/Foo]$ stack build --ghc-options="-Wall" (06-22 01:30)
Foo- unregistering (local file changes: Foo.cabal app/Main.hs package.yaml src/Lib.hs)
Building all executables for `Foo' once. After a successful build of all of them, only specified executables will be rebuilt.
Foo- configure (lib + exe)
Configuring Foo-
Foo- build (lib + exe)
Preprocessing library for Foo-
Building library for Foo-
[1 of 2] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal- )
[2 of 2] Compiling Paths_Foo ( .stack-work/dist/x86_64-osx/Cabal-, .stack-work/dist/x86_64-osx/Cabal- )
Preprocessing executable 'Foo-exe' for Foo-
Building executable 'Foo-exe' for Foo-
[1 of 2] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal- )
/Users/jkoppel/tmp/gadt_failed/Foo/app/Main.hs:22:1: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘fun’: Patterns not matched: (Inl _)
22 | fun (Inr Bar) = 1
| ^^^^^^^^^^^^^^^^^
[2 of 2] Compiling Paths_Foo ( .stack-work/dist/x86_64-osx/Cabal-, .stack-work/dist/x86_64-osx/Cabal- )
Linking .stack-work/dist/x86_64-osx/Cabal- ...
Foo- copy/register
Installing library in /Users/jkoppel/tmp/gadt_failed/Foo/.stack-work/install/x86_64-osx/lts-11.14/8.2.2/lib/x86_64-osx-ghc-8.2.2/Foo-
Installing executable Foo-exe in /Users/jkoppel/tmp/gadt_failed/Foo/.stack-work/install/x86_64-osx/lts-11.14/8.2.2/bin
Registering library for Foo-
{-# LANGUAGE TypeOperators, GADTs, Strict #-}
module Main where
data (:+:) f g a = Inl !(f a) | Inr !(g a)
data A
data B
data Foo l where
Foo :: Foo A
data Bar l where
Bar :: Bar B
type Sig = Foo :+: Bar
fun :: Sig B -> Int
fun (Inr Bar) = 1
main :: IO ()
main = return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment