Skip to content

Instantly share code, notes, and snippets.

@gregberns
Last active January 23, 2019 05:55
Show Gist options
  • Save gregberns/f6f68a33f89ba8182914f28419876257 to your computer and use it in GitHub Desktop.
Save gregberns/f6f68a33f89ba8182914f28419876257 to your computer and use it in GitHub Desktop.
Attempt at running Hedgehog readme examples
module Lib
( someFunc
) where
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
someFunc :: IO ()
someFunc = putStrLn "someFunc"
prop_reverse :: Property
prop_reverse =
property $ do
xs <- forAll $ Gen.list (Range.linear 0 100) Gen.alpha
reverse (reverse xs) === xs
tests1 :: IO Bool
tests1 =
checkParallel $$(discover)
tests2 :: IO Bool
tests2 =
checkParallel $ Group "Test.Example" [
("prop_reverse", prop_reverse)
]
• Variable not in scope:
($$)
:: (Group -> m0 Bool)
-> Hedgehog.Internal.TH.TExpQ Group -> IO Bool
• Perhaps you meant one of these:
‘$’ (imported from Prelude), ‘$!’ (imported from Prelude),
‘<$’ (imported from Prelude)
|
23 | checkParallel $$(discover)
| ^^
• Couldn't match expected type ‘GroupName’
with actual type ‘[Char]’
• In the first argument of ‘Group’, namely ‘"Test.Example"’
In the second argument of ‘($)’, namely
‘Group "Test.Example" [("prop_reverse", prop_reverse)]’
In the expression:
checkParallel
$ Group "Test.Example" [("prop_reverse", prop_reverse)]
|
27 | checkParallel $ Group "Test.Example" [
| ^^^^^^^^^^^^^^
==================================================================
• Couldn't match expected type ‘PropertyName’
with actual type ‘[Char]’
• In the expression: "prop_reverse"
In the expression: ("prop_reverse", prop_reverse)
In the second argument of ‘Group’, namely
‘[("prop_reverse", prop_reverse)]’
|
28 | ("prop_reverse", prop_reverse)
| ^^^^^^^^^^^^^^
@gregberns
Copy link
Author

FIX: Move the language extensions ABOVE the module

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