Skip to content

Instantly share code, notes, and snippets.

@utdemir
Last active November 5, 2017 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utdemir/92d8c4bc3725d52dc01738ab9e4b4bab to your computer and use it in GitHub Desktop.
Save utdemir/92d8c4bc3725d52dc01738ab9e4b4bab to your computer and use it in GitHub Desktop.
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-
This piece of code makes GHC never terminate.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
$ ghc-pkg list | grep servant
servant-0.11
servant-server-0.11.0.1
-}
module Test where
import Servant
type MyAPI = Post '[JSON] () :<|> Get '[JSON] ()
server :: Server IO
server = enter (undefined :: IO :~> Handler) (undefined :: ServerT MyAPI IO)
@utdemir
Copy link
Author

utdemir commented Nov 5, 2017

Line 10 should be server :: Server MyAPI for the program to be type-correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment