Giter Club home page Giter Club logo

purescript-data-default's Introduction

purescript-data-default

Latest release

Default values for purescript types. Inspired by Haskell's data-default package

Installation

spago install data-default

Documentation

Module documentation is published on Pursuit.

Example

import Data.Default
import Data.Maybe (Maybe)

-- Has value 0
x :: Int
x = def

-- Has value Nothing
y :: Maybe String
y = def

data User
  = User String Int

instance defaultUser :: Default User where
  def = User "Max" 99

-- Has value `User "Max" 99`
user :: User
user = def

-- Has value `{name : "", user : User "Max" 99 }`
record :: { name :: String, user :: User }
record = def

purescript-data-default's People

Contributors

deemp avatar drshade avatar thought2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

roryc89 drshade

purescript-data-default's Issues

Support for purescript 0.14

It seems like this package hasn't been updated for purescript 0.14, as it's missing from the default package set, and when adding it as a package directly I get a compile warning and then the terminal error below.

Any plans to update this, or would you be open to receiving a PR? I am happy to take a crack at it.

All the best,
Tom

Compile warning and error:

Compiling Data.Default
Warning found:
at .spago/data-default/v0.3.2/src/Data/Default.purs:48:24 - 48:29 (line 48, column 24 - line 48, column 29)

  Unary '#' syntax for row kinds is deprecated and will be removed in a future release. Use the 'Row' kind instead.


See https://github.com/purescript/documentation/blob/master/errors/WarningParsingModule.md for more information,
or to contribute content related to this warning.


Error found:
in module Data.Default
at .spago/data-default/v0.3.2/src/Data/Default.purs:48:40 - 48:50 (line 48, column 40 - line 48, column 50)

  Could not match kind

    Type -> Type

  with kind

    Type


while checking that type RowList
  has kind Type
in type synonym GDefault$Dict

See https://github.com/purescript/documentation/blob/master/errors/KindsDoNotUnify.md for more information,
or to contribute content related to this error.


[error] Failed to build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.