Skip to content

Instantly share code, notes, and snippets.

View esoeylemez's full-sized avatar

Ertugrul Söylemez esoeylemez

View GitHub Profile
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
import Data.Functor.Const
import Data.Functor.Identity
data Nat = Z | S Nat
-- |
-- Copyright: (c) 2018 Ertugrul Söylemez
-- License: BSD3
-- Maintainer: Ertugrul Söylemez <[email protected]>
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
module Crc32 (crc32M) where
--
-- Benchmark results at the bottom
--
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
@esoeylemez
esoeylemez / reactive-banana-example.hs
Last active April 8, 2018 04:14
reactive-banana main loop example
-- |
-- Copyright: (c) 2018 Ertugrul Söylemez
-- License: BSD3
-- Maintainer: Ertugrul Söylemez <[email protected]>
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Exception
-- Dependencies:
-- * clock
-- * kan-extensions
-- * linear
-- * mwc-random
-- * reflex
-- * sdl2
-- * StateVar
-- * vector
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Exception
import Control.Monad.Codensity
import Control.Monad.Fix
import Control.Monad.IO.Class
import Control.Monad.ST
import Control.Applicative
import Control.Foldl (FoldM(..))
import Control.Monad
import Data.Foldable
import Data.Sequence ((|>))
chunksOf :: (Applicative m) => ([a] -> m ()) -> Int -> FoldM m a ()
chunksOf yield n =
FoldM go
import Control.Monad
import Data.Foldable
import Data.Sequence ((|>))
data Trav a m r = Trav (a -> m (Trav a m r)) (m r)
chunksOf :: (Applicative m) => ([a] -> m ()) -> Int -> Trav a m ()
chunksOf yield n = go mempty
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
import Data.Monoid
class (Monoid a) => Inverse a where
-- |
-- Copyright: (c) 2017 Ertugrul Söylemez
-- License: BSD3
-- Maintainer: Ertugrul Söylemez <[email protected]>
module DevelMain (update) where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception