Skip to content

Instantly share code, notes, and snippets.

View rblaze's full-sized avatar

Andrey Sverdlichenko rblaze

View GitHub Profile
class BaseC t where
foo :: t -> Int
class BaseC t => ImmedC t where
bar :: t -> Int
class ImmedC t => ChildC t where
buz :: t -> Float
instance BaseC Base
module Unittest.Compat.BasicTypes (BasicTypes(..)) where
import qualified Bond.Imports as B'
import qualified Unittest.Compat.Another.Another
import qualified Unittest.Compat.Another.EnumType
import qualified Unittest.Compat.EnumType1
data BasicTypes = BasicTypes{base' ::
Unittest.Compat.Another.Another.Another,
m_bool :: B'.Bool, m_str :: B'.Utf8, m_wstr :: B'.Utf16,
m_uint64 :: B'.Word64, m_uint16 :: B'.Word16,
[24 of 24] Compiling Main ( Main.hs, Main.o )
Main.hs:35:27:
Could not deduce (Typeable a0) arising from a use of ‘mkT’
from the context (Data a)
bound by a type expected by the context: Data a => a -> a
at Main.hs:35:15-43
The type variable ‘a0’ is ambiguous
Note: there are several potential instances:
instance Typeable Compat -- Defined in ‘Unittest.Compat.Compat’
class ConverterInterface {
void WriteInt(int, int);
void WriteDouble(int, double);
}
void convert_stream(Stream stream, ConverterInterface *writer) {
for (auto record : stream) {
if (record.type == INT) {
writer->WriteInt(record.fieldnumber, record.intvalue);
} else if (record.type == DOUBLE) {
module Main where
import Control.Applicative
import Control.Monad
import Data.Binary.Get
import Data.Bits
import Data.Word
import qualified Data.ByteString.Lazy as BS
import Debug.Trace
{-# LANGUAGE ScopedTypeVariables, TypeFamilies, FlexibleContexts #-}
module ZZ where
import Data.Proxy
class Def a where
def :: a
class Def a => Foo a where
type Base a :: *
[1 of 1] Compiling ZZ ( hang.hs, hang.o )
hang.hs:19:31:
Could not deduce (Foo' (Base a)) arising from a use of ‘setBase’
from the context (Foo' a)
bound by the type signature for setBase :: Foo' a => a
at hang.hs:16:12-32
In the expression: setBase
In an equation for ‘d’: d = setBase
In the expression:
{-# LANGUAGE ScopedTypeVariables, TypeFamilies, GADTs #-}
module ZZ where
import Data.Proxy
class Def a where
def :: a
data TWrapper a b where
TW :: (Foo a, Foo b, Base a ~ b) => Proxy a -> Maybe (Proxy b) -> TWrapper a b
@rblaze
rblaze / OOM.hs
Last active August 29, 2015 14:16
{-# LANGUAGE ScopedTypeVariables, TypeFamilies, DeriveDataTypeable #-}
module Unittest.Compat.Containers (Containers(..)) where
import qualified Bond.Imports as B'
import qualified Unittest.Compat.Another.Another
import qualified Unittest.Compat.Another.EnumType
import qualified Unittest.Compat.BasicTypes
import qualified Unittest.Compat.EnumType1
data Containers = Containers{l_bool :: [B'.Bool],
l_str :: [B'.Utf8], l_int8 :: [B'.Int8], l_int16 :: [B'.Int16],
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,C57436288A327D03B9C7B2607E088092
Nil8Qg2o7TFLIyG2zqwjhbAzOYcGuRJfeWsDuG1xQTRJtdxDhglDjlmWSdKmaUPZ
cPUgsU2oO/N1IoVbseqL0newhUvsU9RyOeXQD41gjGjxBYsKV69v7FFQ6Upw0plR
oS2vj637pr2Ax63DwkhPMSubCaC4p1o48FYYGjim4FTcPjvZbnD9d1f2MCA8O6mZ
8Wc+Tk7kF6D3qZUMfw4gixc2ft1ImRIQ5f5ReXHhP3IPpbZfpZbe0Q8lkTiOPIQu
9FdeLMXQZBMENCnIegi1+cI3x6uBcAP4TpXgkXQg8PFQ18epT9epTcMzr7rjLQpd
pWDCO+tqSlzTtknPq4kBQGnbXJ50uRw/kjBMK9DGjU5zO5dvXnk9DMU4N9jMPKzh