overloaded-records: Overloaded Records based on current GHC proposal.

[ bsd3, data, library ] [ Propose Tags ]

Implementation of Overloaded Records based on current GHC proposal.

This implementation is highly experimental and may change rapidly.

More about the current status of OverloadedRecordFields language extension can be found on: GHC Wiki: OverloadedRecordFields.

See README for usage example.


[Skip to Readme]
Versions [RSS] [faq] 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.4.1.0, 0.4.2.0 (info)
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), data-default-class (==0.0.*), template-haskell (>=2.9 && <2.12) [details]
License BSD-3-Clause
Copyright (c) 2016, Peter Trško
Author Peter Trško
Maintainer peter.trsko@gmail.com
Category Data
Home page https://github.com/trskop/overloaded-records
Bug tracker https://github.com/trskop/overloaded-records/issues
Source repo head: git clone git://github.com/trskop/overloaded-records.git
this: git clone git://github.com/trskop/overloaded-records.git(tag 0.1.0.0)
Uploaded by PeterTrsko at 2016-02-28T23:38:03Z
Distributions NixOS:0.4.2.0
Downloads 3529 total (25 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2016-02-28 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
pedantic

Pass additional warning flags to GHC.

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for overloaded-records-0.1.0.0

[back to package description]

Overloaded Records

Hackage Hackage Dependencies Haskell Programming Language BSD3 License

Build

Description

Implementation of /Overloaded Records/ based on current GHC proposal.

This implementation is highly experimental and may change rapidly.

More about the current status of OverloadedRecordFields language extension can be found on GHC Wiki: OverloadedRecordFields.

Usage Example

{-# LANGUAGE DataKinds #-}              -- overloadedRecords, labels
{-# LANGUAGE FlexibleContexts #-}       -- labels
{-# LANGUAGE FlexibleInstances #-}      -- overloadedRecords
{-# LANGUAGE MultiParamTypeClasses #-}  -- overloadedRecords
{-# LANGUAGE TemplateHaskell #-}        -- overloadedRecords, labels
{-# LANGUAGE TypeFamilies #-}           -- overloadedRecords
module FooBar
  where

import Data.Default.Class (Default(def))

import Data.OverloadedRecords.TH (overloadedRecords)
import Data.OverloadedLabels.TH (label, labels)


data Foo a = Foo
    { _x :: Int
    , _y :: a
    }

overloadedRecords def ''Foo
labels ["x", "y"]

newtype Bar a = Bar {_bar :: a}

overloadedRecords def ''Bar
label "bar"

License

The BSD 3-Clause License, see LICENSE file for details. This implementation is based on original prototype, which is under MIT License.

Contributions

Contributions, pull requests and bug reports are welcome! Please don't be afraid to contact author using GitHub or by e-mail.