Skip to content

Instantly share code, notes, and snippets.

@m0ar
Created February 20, 2018 12:08
Show Gist options
  • Save m0ar/e3cc99777eb207ea046a3cabd5734c74 to your computer and use it in GitHub Desktop.
Save m0ar/e3cc99777eb207ea046a3cabd5734c74 to your computer and use it in GitHub Desktop.
-- Test.hs
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE BangPatterns #-}
module Test (mainTest) where
import Weights (Weight(..))
{-# ANN mainTest (Weight 2) #-}
mainTest :: IO ()
mainTest = do
x <- pure 5
y <- derp
return ()
--{-# ANN derp (Weight 3) #-}
derp :: IO Integer
derp = pure 5
-------------------------------------
-- Weights.hs
{-# LANGUAGE DeriveDataTypeable #-}
module Weights (Weight(..)) where
import Data.Data (Data(..))
import Data.Typeable
newtype Weight = Weight Integer deriving (Data, Typeable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment