Last active
December 19, 2019 12:43
-
-
Save JakobBruenker/69f99a23138169a6221d06b5028167f8 to your computer and use it in GitHub Desktop.
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
How.hs:24:13: error: | |
• Could not deduce (Storable t0) | |
from the context: Storable t | |
bound by the type signature for: | |
method :: forall t. Storable t => Int | |
at How.hs:24:13-44 | |
The type variable ‘t0’ is ambiguous | |
• When checking that instance signature for ‘method’ | |
is more general than its signature in the class | |
Instance sig: forall t. Storable t => Int | |
Class sig: forall t. Storable t => Int | |
In the instance declaration for ‘Class String’ | |
| | |
24 | method :: forall t . Storable t => Int t | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
Failed, no modules loaded. |
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 NoStarIsType #-} | |
{-# LANGUAGE TypeFamilyDependencies #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
import Foreign.Storable | |
class Class where | |
method :: forall t . Storable t => Int | |
instance Class where | |
method :: forall t . Storable t => Int | |
method = sizeOf $ (undefined :: t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment