pinch alternatives and similar packages
Based on the "Development" category.
Alternatively, view pinch alternatives based on common mentions on social networks and blogs.
-
structured-haskell-mode
Structured editing minor mode for Haskell in Emacs -
criterion
A powerful but simple library for measuring the performance of Haskell code. -
stgi
A user-centric visual STG implementation to help understand GHC/Haskell's execution model. -
cabal-install-parsers
Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations -
inline-c
Write Haskell source files including C code inline. No FFI required. -
fourmolu
A fourk of ormolu that uses four space indentation and allows arbitrary configuration. Don't like it? PRs welcome! -
inline-java
Haskell/Java interop via inline Java code in Haskell modules. -
gi-atk
Generate Haskell bindings for GObject-Introspection capable libraries -
scion
OLD, DEPRECATED: Use this instead https://github.com/haskell/haskell-ide-engine -
lambdabot-core
A friendly IRC bot and apprentice coder, written in Haskell.
Updating dependencies is time-consuming.
Do you think we are missing an alternative of pinch or a related project?
Popular Comparisons
README
pinch
aims to provide an alternative implementation of Apache Thrift for
Haskell. The pinch
library itself acts only as a serialization library. Types
specify their Thrift encoding by defining instances of the Pinchable
typeclass, which may be done by hand or automatically with the use of Generics.
Haddock documentation for this package is avilable on Hackage and here.
Overview
Types which can be encoded into Thrift payloads implement the Pinchable
typeclass.
Given the Thrift struct,
struct Person {
1: required string name
2: optional i64 dateOfBirth
}
You can write a Pinchable
instance like so,
data Person = Person { name :: Text, dateOfBirth :: Maybe Int64 }
deriving (Eq)
instance Pinchable Person where
type Tag Person = TStruct
-- The Tag tells the system that this represents a struct.
pinch (Person name dateOfBirth) =
struct [1 .= name, 2 ?= dateOfBirth]
unpinch value =
Person <$> value .: 1
<*> value .:? 2
Better yet, you can drive an instance automatically.
{-# LANGUAGE DeriveGeneric, DataKinds #-}
import GHC.Generics (Generic)
data Person = Person
{ name :: Field 1 Text
, dateOfBirth :: Field 2 (Maybe Int64)
} deriving (Eq, Generic)
instance Pinchable Person
Objects can be serialized and deserialized using the encode
and decode
methods. These methods accept a Protocol
as an argument.
decode binaryProtocol (encode binaryProtocol person) == person
For more information, check the documentation and the examples.
Supported Protocols
The following Thrift protocols are supported:
- Binary
- Compact
Caveats
- There is no code generation or template haskell support yet so types from the Thrift file will have to be translated by hand.