Skip to content

Instantly share code, notes, and snippets.

View sheaf's full-sized avatar

sheaf sheaf

View GitHub Profile
@sheaf
sheaf / Bind.hs
Created January 26, 2022 13:57
GHC bug 21010 reproducer
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module Bind ( CBind(..) ) where
import BindA ( WrapMono(..), Constrained(Dom), withMonoCoercible )
class CBind m where
(>>-) :: (Dom m a, Dom m b) => m a -> (a -> m b) -> m b
@sheaf
sheaf / Shape.hs
Last active September 13, 2022 10:48
Shape and contents of a traversable value (cofree traversable)
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
@sheaf
sheaf / simd013.hs
Created August 29, 2024 16:16
GHC C call SIMD bug
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UnliftedFFITypes #-}
-- test C calls with SIMD vectors
module Main where
import GHC.Exts
import GHC.Prim