GithubHelp home page GithubHelp logo

documentation's Introduction

PureScript

Welcome to the PureScript documentation repository!

PureScript is a small, strongly typed programming language that compiles to JavaScript. To get a better overview of PureScript, visit The PureScript Website.

This repository is a collaborative effort, so please feel free to make a pull request to add/edit content or create an issue to discuss it. PureScript is a big project used by people coming from a variety of backgrounds. Making documentation useful to a wide variety of people is really hard to do well, requiring readers like you to point out and add documentation you feel is missing. Thanks for helping!

Directory

Getting Started

Community

  • Discourse: Discuss PureScript in a forum setting
  • Discord: Chat about PureScript and attend video / audio meetups

Learning

Guides

Tools

Ecosystem

Articles

Talks/Meetups

Related Languages

Project Scope

Topics currently in this repository's scope:

  • PureScript language reference documentation
  • Its compiler errors
  • Core concepts on which the language is based
  • Comparison with similar languages
  • An introduction to other sources of documentation

Topics currently not in scope:

  • Using PureScript libraries (those docs belong with the corresponding libraries)
  • A PureScript language teaching course (use the PureScript by Example book or other resources)
  • Introduction to package managers and dependency management

Feel free to make an issue to discuss amending the scope.

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

documentation's People

Contributors

alexchandel avatar andyarvanitis avatar anttih avatar archaeron avatar chexxor avatar csicar avatar damncabbage avatar dgendill avatar epost avatar fisx avatar garyb avatar hdgarrood avatar jdegoes avatar joneshf avatar jordanmartinez avatar joseanpg avatar justinwoo avatar kl0tl avatar kritzcreek avatar lseppala avatar mbbx6spp avatar michaelficarra avatar milesfrain avatar nwolverson avatar paf31 avatar puffnfresh avatar stefanholzmueller avatar thimoteus avatar thomashoneyman avatar xandaros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

documentation's Issues

Move guides to libraries where appropriate

I think some guides would probably be easier to find if they were put in the docs for the relevant libraries. For example:

  • The Partial type class -> purescript-partial
  • QuickCheck -> purescript-quickcheck
  • Eff -> purescript-eff (actually moved to purescript-effect)
  • Generic -> purescript-generics-rep

I also think they'd be less likely to go out of date, as you're more likely to remember to update guides like this if they're right there when you're changing the code.

What do people think?

Automated checking of code examples

Having mistakes such as those addressed by #69, e.g. examples left over from before PureScript had an Int type, is a little embarrassing, in my view. I'd like to investigate some kind of script which ensures that code examples at least compile.

Make it clear Pursuit is the place for documentation

(I couldn't find a better place to leave this comment - sorry.)

When I started learning Purescript, I wanted to find that place that documented all the "obvious" modules. The equivalent of Elm's http://package.elm-lang.org/packages/elm-lang/core/latest/ or https://hexdocs.pm/elixir/Kernel.html for Elixir. There was no obvious pointer to it. It was really just a guess that led me to try Pursuit from http://www.purescript.org/learn/. The text about Pursuit made it seem like (only) the package manager search site: the equivalent of http://package.elm-lang.org or https://hex.pm/packages or https://clojars.org -- not the place to find information everyone should know.

screen shot 2017-02-17 at 4 53 40 pm

Pattern matching - guards not compiling

The code for guards example doesn't compile:

evens :: List Int -> Int
evens Nil = 0
evens (Cons x xs) | x % 2 == 0 = 1 + evens xs
evens (Cons _ xs) = evens xs

It gives:

Error 1 of 1

  Could not match type

    Int

  with type

    Number


while checking that type t0
  is at least as general as type Number
while checking that expression x
  has type Number
while checking the type of a guard clause
in binding group evens

where t0 is an unknown type

Parametricity guide

This would cover questions such as

  • Why is there only one possible Functor Tuple instance
  • How can we make an educated guess at what foldJson from argonaut does just by looking at the type signature

If anyone has any other suggestions for things which would be useful to cover, please comment and let me know.

Document partially applying syntax using `_`

There isn't a single place in which all the _ forms are documented, but there is docs for some specific syntaxes:

But I know it can also be done in case..of expressions, also, but that's not currently documented. Are there other places this can be used?

Should we document this as "Partial application of (special) syntactic expressions"?

Consolidate "FFI" and "FFI tips"

It have been asked a few times on IRC:

  • "How do I return an Either String Int from JS?"
  • "How do I return MyCustomDatatype from JS?"

Two solutions that were brought up were to:

  • send the possible data constructors to be return (example, Left, Right, MyCustomDatatypeConstructor`, etc.),
  • send a function of type String :: Maybe MyCustomDatatype that will get a string version of that constructor and will decide which value to return based on that.

It'd be great if that'd be documented in the FFI guide. :)

"Purescript without Node" - purescript-prelude compilation error

When following the Purescript without Node guide, I get a compilation error of one of the dependencies:

purescript-test/dependencies/purescript-prelude/src/Prelude.purs line 41, column 10 - line 41, column 10

  Unable to parse module:
  unexpected $
  expecting "type", qualifier, identifier or proper name

Using the following environment:

$ psc --version
0.9.3

$ cd ../purescript-prelude/
$ git log -n 1 --decorate=short
commit 5e1d34f6ee771a436286a0335c5de80343dfa6be (HEAD, tag: v0.1.0)
Merge: bfe859a f5d8b7c
Author: Gary Burgess <[email protected]>
Date:   Sun Jun 14 12:46:33 2015 +0100

    Merge pull request #29 from hdgarrood/ord-docs

    Ord docs

$ cd dependencies/purescript-console/
$ git log -n 1 --decorate=short
commit d6654ac2b846982375c58d0b8829b495bc4d6b69 (HEAD, tag: v0.1.0-rc.1, tag: v0.1.0)
Author: Gary Burgess <[email protected]>
Date:   Sat Jun 6 14:30:38 2015 +0100

    Updates for RC

$ cd ../purescript-eff/
$ git log -n 1 --decorate=short
commit df0abe075321c660321e6aefcdff53052ced620f (HEAD, tag: v0.1.0-rc.2, tag: v0.1.0)
Merge: 1f48316 5038b75
Author: Phil Freeman <[email protected]>
Date:   Tue Jun 9 11:38:44 2015 -0700

    Merge pull request #3 from purescript/class

    Move MonadEff over

I'm using the Main.purs from the guide:

module Main where

import Control.Monad.Eff.Console (log)

main = log "Hello, World!"

The reason I reported this bug here is because I suspect that the problem is merely a version mismatch between the compiler and the dependencies.

This is the first time I'm using purescript, so I thought you'd be interested in a use case where this problem is encountered, from a documentation point of view.

Remove references to "psci"

Since there's no command that actually is called "psci" any more (apart from pulp psci, which is only there for backwards compatibility and is no longer documented), I think it would make sense to call it "the repl" in these docs instead.

Document PSCi's browser backend

PSCi has a browser backend, doesn't it? It seems this repo doesn't have docs for it, yet. I recall working with a person several weeks ago who was struggling to use the jquery wrapper with the browser backend, but was getting really frustrated because there were no docs.

installing PS on Linux (Ubuntu and/or Mint)

(ref from purescript/purescript#2819) If it has been fixed then what is the entry point for installing PS on Linux (Ubuntu or Mint etc) ? My searches for guides to install have yielded misleading and contradicting directions. Why do the instructions on the web-page you mention force you into nodejs etc. What OS was your beginner using? I can try using the same as I have plenty of spare hardware here. I managed to compile some simple very crude .psc files into js which is a good start. I built the compiler from scratch - at least then I can see some of the structure and see where is puts the executable. I guess that I am doing it hard but now that I have found that it compiles at least some .psc code I am quite excited to continue. The code that I compiled was done on geany (very quick, flexible and handy) but I could not include any imports. I guess pulp etc would setup an environment for me...

No license

This is a bit of a disaster from a licensing perspective. As I understand it, the content of every accepted PR is All Rights Reserved by its original author. This means users only have the rights ensured by the GitHub TOS, such as to view, fork, etc. but not to use the content for any purpose, and not to redistribute it.

I would have liked this content to be permissively licensed, but it's a bit late now.

This leaves us with a few options:

  • Start over with a fresh license. Obviously this isn't ideal, but I wouldn't be against it if I had more time or more help to rewrite stuff. We might be able to salvage older versions of bits of content if they were moved from old repos with licenses.
  • Try to get previous contributors to explicitly license their content like we did with the compiler repo. We know how that went, and it took a long, long time, and was never even finished. Fortunately, I believe the GitHub terms save us there, since we did have a LICENSE file at least, and users are required to license their PR'd code under the same terms. The same does not apply here, however.

Whatever we do, I would like to start requiring explicit licensing in some form for new contributions.

Remove pages

I think we can remove quite a few pages:

Out of date/no longer necessary

  • 0.7/0.10 Migration Guide
  • PureScript Conf 2015/2016
  • Recommended Libraries (very out of date now, and no longer necessary now that we have the package set repo and Pursuit?)
  • PureScript and Docker (not sure if this still works, but we should check)

Belong elsewhere

  • PSCi (should be in the main repo as a README)
  • Frequently asked psc-ide questions (same)
  • How to implement a foreign function with a constraint (merge with FFI.md?)
  • The Partial Type Class (on the website now - I'm fine with articles living here eventually, but let's pick one?)
  • Documentation Admin (let's make issues for this)
  • Wikipedia Page Proposal (this is still good, but as a draft, I'm not sure it belongs here)

Delete the old wiki

Now seems like a good time to remove the outdated content from the wiki. We should probably keep it active though, with links to the updated material.

Document Generics Rep

There is one or two implementations of Data.Generic.Rep (class Generic), but no tutorial to help know-nothings make an instance of it for their data type. We should make a doc page in the Tutorials or Tasks category for this. It's based on GHC Generics, so we might be able to reference docs from that when writing docs for PureScript's.

Getting started: let in PSCi

The "Getting Started" tutorial uses let twice in PSCi. This throws an error, as
Declarations in PSCi no longer require "let", as of version 0.11.0

Intro to Prelude at PS Unscripted

For now, I'll just post in PS documentation's issues, but we should upload this somewhere for collaboration. As a starting idea: make a directory in this repo called "Intro to Prelude", put this list into a file in it called "index", then update that file to link to videos as they are produced. Or, instead of simply linking to the video in the index file, we make a new file in that directory for each module in which to have proper documentation and a link to the video in which it appears.

I think we can have one grouping of modules to discuss at PS Unscripted each month, but we could do a different meetup/schedule for this if it's popular.

We also need a template to follow when organizing content for the videos, to ensure videos contain information essential to understanding a topic. As a start:

  1. Define module/concept
  2. Explain feeling of when to reach for it in real projects
  3. Show simple example of data structure or library which embodies the module/concept
  4. Show example of more advanced library which uses this module/concept
  5. Questions and comments from listeners

Order of Study for Prelude @ 3.0.0

  • Control.Semigroupoid
  • Control.Category
  • Data.Function
  • Data.NaturalTransformation
  • Data.Void
  • Data.Unit
  • Data.Semigroup
  • Data.Eq
  • Data.Ordering
  • Data.Ord
  • Data.Bounded
  • Data.Semiring
  • Data.Ring
  • Data.CommutativeRing
  • Data.EuclideanRing
  • Data.Field
  • Data.HeytingAlgebra
  • Data.Boolean
  • Data.BooleanAlgebra
  • Data.Show
  • Data.Functor
  • Control.Apply
  • Control.Applicative
  • Control.Bind
  • Control.Monad

Beyond Prelude - Type-level

  • Type.Row
  • Type.Proxy
  • Type.Equality
  • Type.Data.Boolean
  • Type.Data.Ordering
  • Type.Data.Symbol
  • Type.Equality
  • Type.Row.Effect.Equality

Beyond Prelude - Nice To Know About

  • Data.Newtype
  • Data.Const
  • Data.NonEmpty
  • Data.Function.Uncurried
  • Data.Ord
    • Down
    • Max
    • Min

Core Libraries

  • Control.Monad.Eff
    • Console
    • Exception
    • Random
    • Now
    • Ref
    • Timer
    • Uncurried
    • Var
    • Unsafe
  • Data.Monoid
  • Data.Enum
  • Data.BoundedEnum
  • Data.Functor.Compose
  • Data.Functor.App
  • Data.Functor.Product
  • Data.Functor.Product.Nested
  • Data.Functor.Coproduct
  • Data.Functor.Coproduct.Nested
  • Data.Functor.Invariant
  • Control.Extend
  • Control.Alt
  • Control.Plus
  • Control.Alternative
  • Control.MonadZero
  • Control.MonadPlus
  • Data.Bifunctor
    • Clown
    • Joker
    • Wrap
    • Flip
    • Join
    • Product
  • Control.Biapplicative
  • Control.Biapply
  • Data.Profunctor
  • Data.Foldable
  • Data.Unfoldable
  • Data.Traversable
  • Data.Bitraversable
  • Data.Contravariant
  • Data.Comparison
  • Data.Decidable
  • Data.Decide
  • Data.Divide
  • Data.Divisible
  • Data.Equivalence
  • Data.Op
  • Data.Predicate
  • Data.Parallel
  • Data.Inject
  1. Transformers
  • Control.Monad
    • Cont
    • Error
    • Except
    • List
    • Maybe
    • Reader
    • Writer
    • State
    • RWS
  • Control.Comonad
    • Env
    • Store
    • Traced
    • Trans

Beyond Core Libraries - Nice to Know About

  • Data.Exists
  • Data.Lazy
  • Data.MonadRec (Control.Monad.Trampoline)
  • Control.Monad.ST
  • Control.Monad.Eff.Ref
  1. Contrib
  • Lens
  • Profunctor-lens
  • Foreign-lens
  • FreeT
  • HugeNum
  • These
  • Options
  • Aff
  • Aff-Coroutines
  • Coroutines
  • Pair
  • Nullable

Beyond Core Libraries - Data Structures

  • Data.Maybe
  • Data.Either
  • Data.Either.Nested
  • Data.Tuple
  • Data.Tuple.Nested
  • Data.Array
  • Data.Array.Partial
  • Data.Array.ST
  • Data.Array.ST.Partial
  • Data.Array.ST.Iterator
  • Data.List
  • Data.List.NonEmpty
  • Data.List.Lazy
  • Data.List.ZipList
  • Data.CatList
  • Data.CatQueue
  • Data.Set
  • Data.Map
  • Data.StrMap
  • Control.Monad.Free
  • Control.Monad.Trampoline
  • Control.Comonad.Cofree
  • Data.Semiring.Free
  • Data.Graph
  1. Prim
  • Function, (->)
  • Array, []
  • Record, # (Type -> Type), {}
  • Number
  • Int
  • String, ", """
  • Char, '
  • Boolean
  • Partial class
  • Fail class
  • Warn class
  • Union class
  • RowCons class
  • TypeConcat
  • TypeString
  • Type kind
  • Symbol kind

Using npm to install PureScript fails on Arch Linux

It fails by hanging after saying purs isn't working:

$ npm install -g purescript
/home/wink/.npm-global/bin/purs -> /home/wink/.npm-global/lib/node_modules/purescript/bin/purs.js

> [email protected] postinstall /home/wink/.npm-global/lib/node_modules/purescript
> node lib/install.js

  ⚠ The `/home/wink/.npm-global/lib/node_modules/purescript/vendor/purs` binary doesn't seem to work correctly
  ⚠ pre-build test failed
  ℹ compiling from source

The problem is Arch uses ncurses6 where as PS is using ncurses5. I was able to build PS from sources and that worked, but then when I tried to use pulp init it failed saying it couldn't find libtinfo.so.5. The solution ncurses 5 was to install ncurses5-compat-libs after doing so now pulp init worked with my purs compiled from sources.

I then guessed that maybe the reason the npm install -g purescript failed was because I was missing ncurses5. So I removed purs from my $PATH and reran npm install -g purescript and it worked!

So I'd like to suggest the npm instructions in website and Getting Started page be updated to reflect this information. I can take a stab at updating Getting-Started.md if you'd like.

Add section for Tasks-related docs

An idea brought up by andrewc is a curated Purescript cookbook, for examples of things that are just marginally beyond “hello world”.

I agree. We could add a "Tasks" chapter, and curate it like Kubernetes' "Tasks" docs.

Our initial work would be to create a directory in this repo for it, then seed it with 1-3 task docs to provide a template for contributed tasks by the community. We can use one of andrewc's works as an example https://gist.github.com/afcondon/68265847902a3232f228b542d9fd296f

Complete error documentation pages

  • AdditionalProperty
  • AmbiguousTypeVariables
  • ArgListLengthsDiffer
  • CannotDefinePrimModules
  • CannotDerive
  • CannotDeriveNewtypeForData
  • CannotFindDerivingType
  • CannotGeneralizeRecursiveFunction
  • CannotGetFileInfo
  • CannotReadFile
  • CannotUseBindWithDo
  • CannotWriteFile
  • CaseBinderLengthDiffers
  • ClassInstanceArityMismatch
  • ConstrainedTypeUnified
  • CycleInDeclaration
  • CycleInKindDeclaration
  • CycleInModules
  • CycleInTypeClassDeclaration
  • CycleInTypeSynonym
  • DeclConflict
  • DeprecatedFFIPrime
  • DuplicateExportRef
  • DuplicateImport
  • DuplicateImportRef
  • DuplicateInstance
  • DuplicateLabel
  • DuplicateModule
  • DuplicateRoleDeclaration
  • DuplicateSelectiveImport
  • DuplicateTypeArgument
  • DuplicateTypeClass
  • DuplicateValueDeclaration
  • ErrorParsingCSTModule
  • ErrorParsingFFIModule
  • ErrorParsingModule
  • EscapedSkolem
  • ExpectedType
  • ExpectedTypeConstructor
  • ExpectedWildcard
  • ExportConflict
  • ExprDoesNotHaveType
  • ExtraneousClassMember
  • FileIOError
  • HiddenConstructors
  • HidingImport
  • HoleInferredType
  • ImplicitImport
  • ImplicitQualifiedImport
  • ImplicitQualifiedImportReExport
  • ImportHidingModule
  • IncompleteExhaustivityCheck
  • IncorrectAnonymousArgument
  • IncorrectConstructorArity
  • InfiniteKind
  • InfiniteType
  • InternalCompilerError
  • IntOutOfRange
  • InvalidCoercibleInstanceDeclaration
  • InvalidDerivedInstance
  • InvalidDoBind
  • InvalidDoLet
  • InvalidFFIIdentifier
  • InvalidInstanceHead
  • InvalidNewtype
  • InvalidNewtypeInstance
  • InvalidOperatorInBinder
  • KindsDoNotUnify
  • MisleadingEmptyTypeImport
  • MissingClassMember
  • MissingFFIImplementations
  • MissingFFIModule
  • MissingKindDeclaration
  • MissingNewtypeSuperclassInstance
  • MissingTypeDeclaration
  • MixedAssociativityError
  • ModuleNotFound
  • MultipleFFIModules
  • MultipleTypeOpFixities
  • MultipleValueOpFixities
  • NameIsUndefined
  • NoInstanceFound
  • NonAssociativeError
  • OrphanInstance
  • OrphanKindDeclaration
  • OrphanRoleDeclaration
  • OrphanTypeDeclaration
  • OverlappingArgNames
  • OverlappingInstances
  • OverlappingNamesInLet
  • OverlappingPattern
  • PartiallyAppliedSynonym
  • PossiblyInfiniteCoercibleInstance
  • PossiblyInfiniteInstance
  • QuantificationCheckFailureInKind
  • QuantificationCheckFailureInType
  • PropertyIsMissing
  • RedefinedIdent
  • RoleDeclarationArityMismatch
  • RoleMismatch
  • ScopeConflict
  • ScopeShadowing
  • ShadowedName
  • ShadowedTypeVar
  • TypeSynonymInstance
  • TransitiveDctorExportError
  • TransitiveExportError
  • TypesDoNotUnify
  • TypeSynonymInstance
  • UndefinedTypeVariable
  • UnknownClass
  • UnknownExport
  • UnknownExportDataConstructor
  • UnknownImport
  • UnknownImportDataConstructor
  • UnknownName
  • UnnecessaryFFIModule
  • UnsupportedRoleDeclaration
  • UnsupportedTypeInKind
  • UnusableDeclaration
  • UnusedDctorExplicitImport
  • UnusedDctorImport
  • UnusedExplicitImport
  • UnusedFFIImplementations
  • UnusedImport
  • UnusedTypeVar
  • UnverifiableSuperclassInstance
  • UserDefinedWarning
  • VisibleQuantificationCheckFailureInType
  • WarningParsingModule
  • WildcardInferredType

Add titles to pages

It would be nice to add page titles if possible. I'm not sure if this is a quick fix by modifying the existing script or not, but we can close this if it's a hassle now.

Error installing from nom

35778 verbose stack Error: [email protected] postinstall: node lib/install.js
35778 verbose stack Exit status 1
35778 verbose stack at EventEmitter. (/Users/alcaljos/.nvm/versions/node/v7.10.1/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
35778 verbose stack at emitTwo (events.js:106:13)
35778 verbose stack at EventEmitter.emit (events.js:194:7)
35778 verbose stack at ChildProcess. (/Users/alcaljos/.nvm/versions/node/v7.10.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
35778 verbose stack at emitTwo (events.js:106:13)
35778 verbose stack at ChildProcess.emit (events.js:194:7)
35778 verbose stack at maybeClose (internal/child_process.js:899:16)
35778 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
35779 verbose pkgid [email protected]

Duplicated / spread out information

The FFI:

Discover doc format and site generation tool

Before moving to a tool, we should list the advantages we would gain by moving to such a system. Using a GitHub repo for docs, as we are now, is kinda nice for several reasons.

Pros/cons of GitHub repo, no special doc site:

Pros

  • Easy to know how to modify/contribute docs
  • Support for documentation format (markdown)
  • Pre-built searching

Cons

  • No TOC generation
  • No control of search results
  • No control of appearance/styling

owickstrom said on Twitter that he has recently moved from pandoc (?) to sphinx for Hyper's docs. We can view Hyper's doc site as a preview of a PureScript doc site built using Sphinx.

Module not found errors when trying Getting Started with PureScript

Run:

npm install -g purescript pulp bower
pulp init
bower install purescript-outwatch
npm install rxjs snabbdom

Edit src/Main.purs:

module Main where

import OutWatch

main = render "#app" (h1 [text "Hello World"])

Create index.html:

<body>
  <div id="app"></div>
  <script type="text/javascript" src="index.js"></script>
</body>

Run:

pulp --watch browserify --to index.js

Output:

Error 1 of 3:

  in module RxJS.Observable
  at bower_components/purescript-rxps/src/RxJS/Observable.purs line 117, column 1 - line 117, column 52

    Module Test.QuickCheck was not found.
    Make sure the source file exists, and that it has been provided as an input to psc.


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

Error 2 of 3:

  in module RxJS.Observable
  at bower_components/purescript-rxps/src/RxJS/Observable.purs line 118, column 1 - line 118, column 37

    Module Test.QuickCheck.Gen was not found.
    Make sure the source file exists, and that it has been provided as an input to psc.


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

Error 3 of 3:

  in module Main
  at src/Main.purs line 3, column 1 - line 3, column 16

    Module OutWatch was not found.
    Make sure the source file exists, and that it has been provided as an input to psc.


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


* ERROR: Subcommand terminated with exit code 1

Find place to put TIL-style info

One part of learning a language is idioms. One way to learn a language's idioms is by seeing alternate ways of writing a thing.

For example:

  • people first learn logShow, then discover traceAny.
  • people first learn "do-notation", then discover that using >>=, <$>, and maybe >=> is a better way.
  • people first learn records, then discover ADTs and lens are better.
  • people first learn ContT, then discover Aff is better, or vice-versa.
  • people first learn Either MultipleErrors a, then discover clever use of ExceptT is a bit better.
  • people first use simple recursion, then discover MonadRec or fix-point concepts are very helpful.

These TILs would need to be structured, somehow. Perhaps by problem category?

  • Debugging
  • Parsing
  • Error-handling
  • Data structures

Perhaps these TILs could be integrated into another hierarchy of docs, like alongside a curriculum having practice exercises for introducing these problem categories?

From old 'Documentation Admin' page

Things that people wanted documenting:

  • Newtype
    -- Difference between keyword and type class.
    -- Removed runAdditive in v0.10, moved to wrap from Newtype class. Why have run* in first place?

  • Functional Dependencies
    -- What type-checking errors does it resolve?
    -- When should I use functional dependency in my type class?

  • Typed-holes and type wildcards
    -- Names are similar, needs clarification.

  • Compile Iteration Techniques
    -- Hole-driven development with typed-holes.
    -- Faculties of editor plugins. Using pscid as editor-independent alternative.
    -- Iterating module while testing in psci.

  • Generics
    -- How to use generics to encodeJson from argonaut?
    -- Old generics (purescript-generics) vs new generics (purescript-generics-rep, enabled by fun-deps)

Document optimizer rules

Some PS functions are optimized away, like (<<<) and ($). We should add a docpage which introduces the optimizer and some important things to know it does, as a PureScript user.

I've avoided using ($) because I thought it added another layer to the stack for each use, but I'll use it more after learning that PSC optimizes it away.

i can't get particular value from API object response

I am fetching api responce as a:

result = studentInfo: StudentInfo
{
department : ["Account", "Register", "Sport", "Social", "Hostel"]
,branch : {id : "001",name : "IT", count: 50 , year :2017}
}

and i will try to get only count value from branch and assing to simple number variable, but we can't get count value.

i am tring to get count value as a:
result.branch{count}
result.branch.count
result{branch{count}}
result{branch.count}

but its shows error "Could not match type"

how to get count value in purescript code.
please help me to resolved that issue.

Documenting the required eta-expansion for using default implementations

Some type classes provide default implementations as functions (since default members are not supported yet). However, to use those, one needs eta-expand them, or the compiler will yell that the instance does not exist yet.

I'm not sure how this restriction comes up, but it would be nice to document this.

I think it might fit in the Haskell differences part, in the section about the lack of default members.

Warning points to UnusedImport.md but it does not exist

I hope that this is the right place: while doing the exercises for the book I got some warnings where the link destination does not exist. https://github.com/purescript/purescript/blob/master/src/Language/PureScript/Errors.hs#L154 does point to UnusedImport.md here but the document is missing from this repo which is why I opened this issue here.

Warning 4 of 4:

  in module Data.AddressBook
  at src/Data/AddressBook.purs line 7, column 1 - line 7, column 26

    The import of module Data.Maybe is redundant


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

It's not a big deal but coming from Erlang/Elixir the learning curve is pretty steep (as noted by @marick in #43) so I tried to look up what I actually did wrong.

Thanks!

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.