BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Note to self: type variables in and cannot be bound to partially applied type synonyms.

If you try to do so, in a sufficiently polymorphic way, you'll get very confusing type errors as the checker attempts to solve things with the variable bound to the "head" of the (parametrically expanded) type alias.

Last night it was (forall r. (forall f. Foldable1 f => f a -> r) -> r) and tonight it was (a -> Term a). Introducing a newtype can help, but beware impredicativity.

eh, to random
@eh@functional.cafe avatar

What is the best way to start using + halogen with on ARM and macOS? purs-nix seems to only support x86_64. :|

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@eh If you don't have non-purescript dependencies, you might just start with a nix setup for npm. Spago package sets are nix-ish handling for purescript deps.

Best of luck. Boosted for reach.

haskman, to javascript
@haskman@functional.cafe avatar

Since the backend post (https://www.moonbitlang.com/blog/js-support) is trending, I thought I'd compare backend optimizer (https://github.com/aristanetworks/purescript-backend-optimizer) output to see how it fares. The results were pretty good!

With basically this PureScript code -

run = fromArray  
 >>> flatMapF (fromArray <<< _.members)  
 >>> filterF _.gender  
 >>> mapF (\x -> min 100 (x.score + 5))  
 >>> mapF grade  
 >>> filterF (_ == 'A')  
 >>> foldF (\_ x -> x+1) 0  

the benchmark results are as follows. PureScript is roughly 6x faster than plain JS, and 6x slower than Moonbit output ( -

┌─────────┬──────────────┬─────────────┬────────────────────┬──────────┬─────────┐  
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │  
├─────────┼──────────────┼─────────────┼────────────────────┼──────────┼─────────┤  
│ 0 │ 'Moonbit' │ '34,67,542' │ 288.38869989829305 │ '±0.06%' │ 1733772 │  
│ 1 │ 'Plain Js' │ '74,816' │ 13365.983827421464 │ '±0.54%' │ 37409 │  
│ 2 │ 'Kotlin Js' │ '1,90,241' │ 5256.474017304151 │ '±0.38%' │ 95121 │  
│ 3 │ 'PureScript' │ '4,99,456' │ 2002.1768597161156 │ '±0.70%' │ 249729 │  
└─────────┴──────────────┴─────────────┴────────────────────┴──────────┴─────────┘  

haskman,
@haskman@functional.cafe avatar
haskman,
@haskman@functional.cafe avatar

A great example of how cool PureScript backend optimizer is - The PureScript code makes multiple map and filter calls and also calls into two functions with complicated logic. The generated output shows that the PS code was aggressively inlined into a tiny bit of JS code -

on the left : on the right

The tiny bit of JS code that was generated for the above PS code

BoydStephenSmithJr, to fediverse
@BoydStephenSmithJr@hachyderm.io avatar

So, I finished my first coding and music stream on https://video.infosec.exchange/w/hmradyAMD5rJ6LKWVUiJLk if you want to watch someone fight type errors around right Kan extensions in enjoy!

I think next time I might not start in the middle of a large project. Needs to be more like Joy of Painting and start with a blank "canvas". Probably just grab a problem from the cyber-dojo and plug at it.

Let me know if the music is too loud or the font to unreadable.

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Anyone want to volunteer a guide for when to use instead of in or ?

I'm wanting to provide an HFunctor (https://pursuit.purescript.org/packages/purescript-fix-functor/0.1.0/docs/FixFunctor#t:HFunctor) instance but the naive way to do that requires me to "invent" a Functor instance for the source type constructor -- thinking of adding a yoneda/coyoneda wrapper and I think either would work, but I'm not sure.

BoydStephenSmithJr, to random
@BoydStephenSmithJr@hachyderm.io avatar

Bah, doesn't call it "strict positivity", but it doesn't let me violate that and derive Functor. Sometimes I think the "efficient DeBruijn" of 's Scope gets paid for in programmer time. :blobfoxlaughsweat:

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Any experience with turning non-uniform recursion schemes (http://www.cs.nott.ac.uk/Research/fop/blampied-thesis.pdf) into a library that works like or -schemes

I've got a specific type that uses a approach but I'd like to write some general folds (using e.g. algebra families) instead of duplicating the "traversal" code.

I might have done the categorical approach (functor categories instead of algebra families) before, but that has limitations and I think I lost the code.

BoydStephenSmithJr, to random
@BoydStephenSmithJr@hachyderm.io avatar

Updated my ugly-ass lambda calculus thing on my website (https://www.iguanasuicide.net/) and now you can click the name of the reduction to perform it.

#purescript #LambdaCalculus

BoydStephenSmithJr, to random
@BoydStephenSmithJr@hachyderm.io avatar

Mildly disappointed that spago@next is using YAML instead of Dhall. :blobfoxannoyed:

I'm going to hold off as long as possible, but I do want to figure out how to get source maps working, with or without parcel.

BoydStephenSmithJr, to random
@BoydStephenSmithJr@hachyderm.io avatar

I got around to adding bounds-checking to my interactive lambda-calculus toy: https://bss03.gitlab.io/halogen-lambda/

I need to change the bounds-checking component to use an AST next.

Then, step-wise evaluation, if bounds-checking passes.

I really like the framework for SPAs.

BoydStephenSmithJr, to random
@BoydStephenSmithJr@hachyderm.io avatar

What's the easiest way to put my application on my website? Even better if I can easily install it as a sub-site?

My current method is barely remembered, haphazard, and also breaks as soon as I put it not at the root (can't find CSS / JS, I think?).

Alternatively, I'd also be open to using pages; the main repository is already hosted there.

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Typed holes (in or GHC or wherever) are just too useful. I don't know how to operate in higher-order / heavily polymorphic code without them anymore. :blobfoxgooglyconfused:

Writing a new language is hard... so much to implement before I'm even willing to use it myself! 😜

ctietze, to random
@ctietze@mastodon.social avatar

The Magic of Property Testing
https://www.youtube.com/watch?v=4bpc8NpNHRc

@krisajenkins followed up on Property-Based Testing and I love the demo.

Also looks cools

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Anyone know of an interactive "lambda calculus" expression evaluation site? Or something in that UX neighborhood that I should use for inspiration?

I know I used to answer a lot of questions just by stepping though evaluation. I thought it would be nice to have that on a website and I have a basic expression parser and visualizer in running on my website ("production" is a buggy version, tho) but need to design interactive stepping.

https://gitlab.com/bss03/halogen-lambda

jaror,
jaror avatar

@BoydStephenSmithJr there is https://chrisdone.com/toys/duet-delta/ which is fully online and https://www.well-typed.com/blog/2017/09/visualize-cbn/ which is a tool that can generate interactive html pages. The latter supports much more of Haskell, I believe.

haskman, to FunctionalProgramming
@haskman@functional.cafe avatar

people on : I am now moderating the and communities on Programming.dev.

The best part is that you can also (sort of) follow them from . Search for the following URLs in your mastodon client

https://programming.dev/c/purescript, and https://programming.dev/c/haskell

See you there!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • tacticalgear
  • DreamBathrooms
  • osvaldo12
  • mdbf
  • everett
  • magazineikmin
  • khanakhh
  • Youngstown
  • rosin
  • slotface
  • modclub
  • kavyap
  • tester
  • JUstTest
  • ngwrru68w68
  • thenastyranch
  • cisconetworking
  • Durango
  • ethstaker
  • InstantRegret
  • Leos
  • anitta
  • GTA5RPClips
  • normalnudes
  • cubers
  • provamag3
  • lostlight
  • All magazines