Skip to content

Instantly share code, notes, and snippets.

class ResultMeta resultType where
getContinue :: resultType -> Maybe KM.Continue
getLength :: resultType -> Int
class ApiRequest api where
type ApiResult api :: *
type CoreRequest api :: *
@lally
lally / Query.hs
Created June 24, 2020 19:54
Ambiguous api0 with api
class QueryResult api where
type Query api :: *
addContinue :: Maybe KM.Continue -> Query api -> Query api
setupWithLimit :: CloudConfig -> Maybe Int -> Query api -> Query api
{-
cloud-analyzer> • Couldn't match type ‘Query api0’ with ‘Query api’
cloud-analyzer> Expected type: Maybe KM.Continue -> Query api -> Query api
cloud-analyzer> Actual type: Maybe KM.Continue -> Query api0 -> Query api0
cloud-analyzer> NB: ‘Query’ is a non-injective type family
#include <algorithm>
#include <atomic>
#include <cstdint>
#include <linux/perf_event.h>
#include <stdio.h>
#include <string.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <syscall.h>
#include <time.h>
@lally
lally / ppt-Minimal.cc
Created September 6, 2019 17:22
generated ppt-Minimal.cc
#include "ppt-Minimal.hh"
#include <algorithm>
#include <atomic>
#include <cstdint>
#include <linux/perf_event.h>
#include <stdio.h>
#include <string.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <syscall.h>

Keybase proof

I hereby claim:

  • I am lally on github.
  • I am lally (https://keybase.io/lally) on keybase.
  • I have a public key ASDbbtA-UvdZJpovY0H0N3T8VS1eTiL5BWlEUVr6iiXv9go
@lally
lally / echo.hs
Created December 9, 2010 13:39
It should print out its first argument via a call to puts().
type MainFunction = Function (Int32 -> Ptr (Ptr Word8) -> IO Int32)
buildReaderFun :: String -> CodeGenModule (MainFunction)
buildReaderFun nm = do
puts <- newNamedFunction ExternalLinkage "puts" ::
TFunction (Ptr Word8 -> IO Word32)
let callPuts format = (
createNamedFunction ExternalLinkage "main" $
\ argc argv -> do