Skip to content

Instantly share code, notes, and snippets.

@ndtimofeev
ndtimofeev / Generic_with_GADT.hs
Created July 5, 2016 12:09
GADT wrapped Generic type
{-# LANGUAGE DataKinds, GADTs, DeriveGeneric #-}
import GHC.Generics
data T a where
MkT1 :: T True
MkT2 :: T False
data T2 = T2 (T False)
deriving Generic
// core
#include <QObject>
#include <QTimer>
#include <QDebug>
// network
#include <QLocalSocket>
#include <QLocalServer>
// widgets
module Control.Monad.Step
( Step
, MonadStep(..)
, mapStep
, mapStep_
, runStepWithMask
, runStep
, evalScriptWithMask
, evalScript )
where
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
module Control.Monad.Exception
( Exception(..)
, SomeException( SomeException )
, StackInfo(..)
, throw
data Linker = Emplty | Dash | Equal | Octothrope
deriving (Eq, Ord, Show)
data Polygon edge vertex
= Polygon !vertex !edge !(Polygon edge vertex)
| Line !vertex !edge !vertex
deriving (Eq, Ord, Show, Functor, Foldable, Traversable)
data SignumForm = Prefix | Postfix | Binary
deriving (Eq, Ord, Show)
main :: IO ()
main = do
tid1 <- forkIO $ magicMask $ do
localTid <- myThread
tid2 <- forkIO $ do
threadDelay (42 * 42)
killThread localTid
forever $ threadDelay 777
tid3 <- forkIO $ do
{-# LANGUAGE Rank2Types #-}
module Managed where
-- base
import Data.IORef
-- exceptions
import Control.Monad.Catch
-- base
import Control.Applicative
import Control.Monad
import Data.Maybe
import Data.Word
import Data.Proxy
import GHC.TypeLits
module CoCoCoOutput where
import Control.Exception
import Control.Concurrent.Async
import Control.Concurrent.Chan
import Control.Monad
import Data.Function
{-# LANGUAGE ExistentialQuantification #-}
-- base
import Control.Exception
import Control.Concurrent.MVar
import Control.Monad
import Data.IORef
import System.IO.Unsafe