packages feed

Shpadoinkle-console 0.0.1.3 → 0.0.1.4

raw patch · 3 files changed

+33/−53 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

− CHANGELOG.md
README.md view
@@ -1,6 +1,6 @@ # Shpadoinkle Console -[![Goldwater](https://gitlab.com/fresheyeball/Shpadoinkle/badges/master/pipeline.svg)](https://gitlab.com/fresheyeball/Shpadoinkle)+[![Goldwater](https://gitlab.com/platonic/shpadoinkle/badges/master/pipeline.svg)](https://gitlab.com/platonic/shpadoinkle) [![Haddock](https://img.shields.io/badge/haddock-master-informational)](https://shpadoinkle.org/console) [![BSD-3](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![built with nix](https://img.shields.io/badge/built%20with-nix-41439a)](https://builtwithnix.org)@@ -8,28 +8,4 @@ [![Hackage Deps](https://img.shields.io/hackage-deps/v/Shpadoinkle-console.svg)](http://packdeps.haskellers.com/reverse/Shpadoinkle-console) [![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/Shpadoinkle-console/badge)](https://matrix.hackage.haskell.org/#/package/Shpadoinkle-console) -This package exposes some useful debugging functions for tracing the state of Shpadoinkle applications as they change over time. It exposes some type classes currently.--```haskell-class LogJS (c :: Type -> Constraint) where-  logJS :: c a => a -> JSM ()--class LogJS c => Trapper c where-  trapper :: c a => JSContextRef -> a -> a--class Assert (c :: Type -> Constraint) where-  assert :: c a => Bool -> a -> JSM ()-```--These are intended to by used with `TypeApplications`, so you can choose the means of conversion before passing to `console.log`. For example:--```haskell-main :: IO ()-main = runJSorWarp 8080 $ do-  ctx <- askJSM-  simple runParDiff initial (view . trapper @ToJSON ctx) getBody-```--This will log all state by first encoding to JSON with Aeson, then then logging with `JSON.parse` so the browser console has the nice native display. If we change it to `trapper @Show ctx` it will use the `Show` instance instead.--We also export a handful of `console` bindings such as `console.time`, `console.table`, `console.info`, `console.warn`, `console.debug`, and of course `console.log`.+## [Documentation ->](https://shpadoinkle.org/packages/console)
Shpadoinkle-console.cabal view
@@ -1,37 +1,40 @@-cabal-version: 1.12---- This file has been generated from package.yaml by hpack version 0.33.0.------ see: https://github.com/sol/hpack------ hash: 523d3becab4a163a5f813a827ffaa8faf106b8e06117b64af78ee669ec2b9ee9--name:           Shpadoinkle-console-version:        0.0.1.3-synopsis:       Support for the native browser console-description:    This package adds support for native browser console features for logging and debugging.-category:       Web-author:         Isaac Shapira-maintainer:     fresheyeball@protonmail.com-license:        BSD3-license-file:   LICENSE-build-type:     Simple+cabal-version: 2.2+name:          Shpadoinkle-console+version:       0.0.1.4+category:      Web+author:        Isaac Shapira+maintainer:    isaac.shapira@platonic.systems+license:       BSD-3-Clause+license-file:  LICENSE+build-type:    Simple extra-source-files:-    README.md-    CHANGELOG.md+  README.md+synopsis:+  Support for the native browser console+description:+  This package adds support for native browser console features for logging and debugging. + source-repository head   type: git-  location: https://gitlab.com/fresheyeball/Shpadoinkle.git+  location: https://gitlab.com/platonic/shpadoinkle.git + library   exposed-modules:-      Shpadoinkle.Console-  other-modules:-      Paths_Shpadoinkle_console-  hs-source-dirs:-      ./.-  ghc-options: -Wall -Wcompat -fwarn-redundant-constraints -fwarn-incomplete-uni-patterns -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-identities+    Shpadoinkle.Console++  hs-source-dirs: .++  ghc-options:+    -Wall+    -Wcompat+    -fwarn-redundant-constraints+    -fwarn-incomplete-uni-patterns+    -fwarn-tabs+    -fwarn-incomplete-record-updates+    -fwarn-identities+   build-depends:       aeson >=1.4.4 && <1.6     , base >=4.12.0 && <4.16@@ -39,4 +42,5 @@     , lens >=4.17.1 && <5.0     , text >=1.2.3 && <1.3     , unliftio >=0.2.12 && <0.3+   default-language: Haskell2010