GithubHelp home page GithubHelp logo

bgamari / foundation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haskell-foundation/foundation

0.0 3.0 0.0 2.43 MB

Empire strikes back

License: Other

Haskell 98.19% C 1.68% Shell 0.13%

foundation's Introduction

Foundation

Continuous integration Doc Stackage version Hackage version BSD3 Haskell Coverage Status

Documentation:

Discuss:

Goals

  • provide a base like set of modules that provide a consistent set of features and bugfixes across multiple versions of GHC (unlike base).
  • provide a better and more efficient prelude than base's prelude.
  • be self-sufficient: no external dependencies apart from base (or ghc packages).
  • provide better data-types: packed unicode string by default, arrays.
  • Better numerical classes that better represent mathematical things (No more all-in-one Num).

Support

See Haskell packages guidelines

Usage

How to use with the normal Prelude

Add the foundation package in your cabal file, and it's recommended to import Foundation qualified if you're planning to use with the normal Prelude:

For example:

import qualified Foundation as F

It's also recommended if you're going to deal with packages using text, bytestring, vector.. to use the foundation-edge package.

How to use fully without Prelude

Disable the built-in prelude at the top of your file:

{-# LANGUAGE NoImplicitPrelude #-}

Or directly in your project cabal file:

Default-Extensions: NoImplicitPrelude

Then in your modules:

import Foundation

Advanced settings

Please check out the chapter Advanced Usage Options in the documentation.

How to contribute

Contribution guide can be found here.

Profiling

If you want to see the core (simpl step) or the assembly (asm step), then you can build with

stack build --ghc-options -ddump-simpl --ghc-options -ddump-asm

Note that it doesn't actually will create the necessary extra files if the modules doesn't need building.

you can then find your build by-products in:

.stack-work/dist/<architecture>/Cabal-<CabalVersion>/build/

Each modules that get compiled will create an equivalent file in the build directory:

  • ModuleName.dump-simpl
  • ModuleName.dump-asm

For profiling individual programs, the following command is useful:

stack ghc -- -O --make X.hs -prof -auto-all -caf-all -fforce-recomp

Benchmarking

To get the list of benchmark:

stack bench --benchmark-arguments -l

To compare against other libraries, you need to set the bench-all flag

stack bench --flag foundation:bench-all --benchmark-arguments -l

To run a specific or set of benchmarks :

stack bench --flag foundation:bench-all --benchmark-arguments 'types/String/SplitAt/mascii-10/Text'
stack bench --flag foundation:bench-all --benchmark-arguments '-m prefix types/String/SplitAt'
stack bench --flag foundation:bench-all --benchmark-arguments '-m glob types/String/SplitAt'

To register a set of benchmarks:

stack bench --flag foundation:bench-all --benchmark-arguments "--csv $(git describe).csv"

Design

Foundation started on the simple idea of trying to put everything I need in one simple and consistent package. The amazing haskell ecosystem is extremely fragmented and maintained by different people with different goals, free time, and style. The overall scare of not trying to change anything relatively central (base, bytestring, text, vector, ...) for a promise of stability has pushed many people to work on their own thing, leading to unnecessary work duplication and further fragmentation.

Foundation uses and abuses type families.

Code Organisation

Every foundation modules start by Foundation.

  • Foundation is the prelude replacement module.
  • Basement.Compat contains only compatibilty and re-export from ghc/ghc-prim/base.
  • Foundation.Primitive is where all the lowlevel magic happens:
    • Important types that underpins many others part
    • Pervasive features

foundation's People

Contributors

vincenthz avatar nicolasdp avatar jange avatar ciderale avatar adinapoli avatar ndmitchell avatar galderz avatar threefx avatar picnoir avatar jship avatar angerman avatar snoyberg avatar ryanglscott avatar dtaskoff avatar akshaymankar avatar aherrmann avatar argumatronic avatar tekul avatar tmcdonell avatar teodorlu avatar sighingnow avatar purcell avatar nwtgck avatar plaprade avatar klacansky avatar phadej avatar mitchellwrosen avatar matthewbauer avatar mlongob avatar lortabac avatar

Watchers

James Cloos avatar Ben Gamari avatar  avatar

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.