TIL #GHC already has some functionality in place to check that a function is only used at a monomorphic type. Currently, I think it is only used for `tagToEnum#` but it would be useful to properly integrate it into the type system.

#haskell

#haskell development be mostly busywork for new #ghc versions...

2d61b20 relax dependencies for ghc-9.14
df41b88 relax dependencies for ghc-9.8
f5ce400 relax dependencies for ghc-9.6
4b4417f (tag: v0.1.2.1) v0.1.2.1
28330e6 relax dependencies for ghc-9.4
eac7560 fix incorrect wrapper on Win64
4ea1b67 bump dependencies for ghc 9.2

An new proposal for passing implicit parameters to #Haskell functions: https://github.com/ghc-proposals/ghc-proposals/pull/741

Done the right way; as opposed to the existing ImplicitParams extension, which is practically useless.

#GHC

Nominal implicit parameters by lortabac · Pull Request #741 · ghc-proposals/ghc-proposals

This proposal introduces NominalImplicitParams, a new GHC extension that provides first-class support for dynamic scoping with robust and predictable semantics. Rendered

GitHub
Is "in the first argument of..." etc in type error messages useful?

In case any readers don’t know (it is not well documented): you can disable the “In the first argument of” etc. contextual messages with the GHC option -fno-show-error-context, see Debugging Haskell Type Errors - #4 by MangoIV you can set a limit for the “Relevant bindings include” section with -fmax-relevant-binds=⟨n⟩, see 5.3. Optimisation (code improvement) — Glasgow Haskell Compiler 9.14.1 User's Guide … but -fmax-relevant-binds=0 didn’t work as expected for me

Haskell Community

https://www.reddit.com/r/haskell/comments/plfotc/comment/hcd0le4/

I just learnt two important examples that #GHC fails to optimise code:
one being `Map.fromSet` on polymorphic type, the other being improperly inlining `Set.fromList somelist`.

#Haskell #Compiler

impurepics - #Haskell Extensions
https://impurepics.com/posts/2019-08-01-haskell-extensions.html

A collection of short descriptions and examples of #GHC extensions

#PL #FP

impurepics - Haskell Extensions

impurepics, all kinds of impure pics

#Haskell New Year Resolutions
https://discourse.haskell.org/t/haskell-new-year-resolutions/13478

These are very useful advices!

I learnt:
- Generically and DerivingVia
- StarIsType
- DuplicateRecordFields, NoFieldSelectors, and OverloadedRecordDot

I must admits that there are just too many extensions in #GHC...

#NewYearResolution #newyear2026 #FP #Programming

Haskell New Year Resolutions

When defining a typeclass that can be generically derived, add the corresponding Generically instance. When writing FFI bindings, use the capi calling convention, where appropiate. Down with * for kinds, use Type instead. (See StarIsType/NoStarIsType). Consider using the GHC2024 language edition when compatibility with older GHCs is not an issue. Add StandaloneKindSignatures (part of GHC2024) to clarify complex type constructors. Use List in signatures, instead of the [] type constructor. (See L...

Haskell Community

niklas-heer/speed-comparison: A repo which compares the speed of different programming languages.
https://github.com/niklas-heer/speed-comparison

This projects tries to compare the speed of different #programming languages. It uses an implementation of the Leibniz formula for π to do the comparison.

Notably:
- #Julia is the only dynamically-typed languages amoung the top tier, only ~28ms slower from #Cpp (#Clang).
- #Rust got a huge boost with nightly compiler (it is said that hand-written SIMD is used?)
- #Go tops in 3rd tier (very crowded 0.8s~1s)
- #PyPy and #Haskell (#GHC) are very closed (~1s), preceding #Racket, beating #Python (#NumPy) by a lot (~1.2s)
- The slowest is #CPython (~86s)

#Math #ScientificComputing

PSA: When using the #GHC API, the `setSessionDynFlags` function will modify the DynFlags, so be sure to discard the old DynFlags and use `getSessionDynFlags` if you need them again later.

Thanks to Rodrigo Mesquita for helping me figure this out!

#haskell