jaror avatar

jaror

@jaror@kbin.social

All the side effects were never mentioned to me
I am innocent of uncontrolled abuse

pmidden, to haskell
@pmidden@fosstodon.org avatar

TIL about MicroHs, an alternative compiler that can compile Haskell2010 https://hackage.haskell.org/package/MicroHs-0.9.8.0

jaror,
jaror avatar

@pmidden There's also a recording of Lennart Augustsson talking about how and why he made it: https://www.youtube.com/watch?v=Zk5SJ79nOnA

CLC Election September 2023 (discourse.haskell.org)

CLC seeks nominations for a vacant seat. Who should apply? Anyone who meets the following criteria should apply: Candidates should have enough bandwidth to review merge requests to base on a semi-frequent basis (3 to 5 per month), and sustain this for their 3 years term in a healthy manner. Candidates should be able to...

Haskell Interlude 41: Mike Angermann (haskell.foundation)

Today, Matthías and Joachim are interviewing Moritz Angermann. Moritz knew he wanted to use Haskell before he knew Haskell, fixed cross-compilation as his first GHC contribution. We'll talk more about cross-compilation to Windows and mobile platforms, why Template Haskell is the cause of most headaches, why you should be...

jaror,
jaror avatar

The discussion about incentives for stability was interesting. It reminded me of the maintainership standards proposal. I think it would be very useful to have Hackage show information like how quickly a package fixes version bounds when new versions of their dependencies are released.

[Well-Typed Blog] Choreographing a dance with the GHC specializer (Part 1) (well-typed.com)

This is the first of a two-part series of blog posts on GHC specialization, an optimization technique used by GHC to eliminate the performance overhead of ad-hoc polymorphism and enable other powerful optimizations. There will also be a Haskell Unfolder episode about this topic.

The Haskell Unfolder Episode 22: foldr-build fusion (well-typed.com)

When composing several list-processing functions, GHC employs an optimisation called foldr-build fusion. Fusion combines functions in such a way that any intermediate lists can often be eliminated completely. In this episode, we will look at how this optimisation works, and at how it is implemented in GHC: not as built-in...

[Well-Typed Blog] Improvements to the ghc-debug terminal interface (www.well-typed.com)

ghc-debug is a debugging tool for performing precise heap analysis of Haskell programs (check out our previous post introducing it). While working on Eras Profiling, we took the opportunity to make some much needed improvements and quality of life fixes to both the ghc-debug library and the...

[Well-Typed] The Haskell Unfolder Episode 18: computing constraints (well-typed.com)

Sometimes, for example when working with type-level lists, you have to compute with constraints. For example, you might want to say that a constraint holds for all types in a type-level list. In this episode, we will explore this special case of type-level programming in Haskell. We will also revisit type class aliases and take...

Profpatsch, to haskell
@Profpatsch@mastodon.xyz avatar

on, the most useless function in base. There’s really never a situation where inlining it doesn’t make the code easier to understand.

jaror,
jaror avatar

@Profpatsch compare `on` length to me seems much nicer than \x y -> compare (length x) (length y)

pmidden, to haskell
@pmidden@fosstodon.org avatar

language server now offers helpful tips. However, stuff like "length will fail on infinite lists is certainly unhelpful for almost all (hehe) lists. And it has no code action to turn it off easily. A little annoying then.

jaror,
jaror avatar

@pmidden That warning is from Stan and was briefly enabled by default. HLS 2.6.0.0 has it disabled by default.

jaror, to haskell
jaror avatar

I enjoyed the simplicity of this recent Computerphile video on web servers: https://www.youtube.com/watch?v=7GBlCinu9yg

I attempted to recreate it in , but we don't really have a library on the same level of abstraction. wai is too abstract and network is not abstract enough.

jaror,
jaror avatar

Actually, if you combine network with network-run then it is the right level of abstraction:

{- cabal:
build-depends: base, network, network-run, monad-loops
-}

import Network.Run.TCP
import Network.Socket
import System.IO
import Control.Monad.Loops

main = runTCPServer (Just "127.0.0.1") "9999" talk where
  talk s = do
    h <- socketToHandle s ReadWriteMode
    l <- hGetLine h
    case words l of
      ["GET", resource, "HTTP/1.1"] -> do
        whileM_ (("\r" /=) <$> hGetLine h) (pure ())
        let path = concat
              [ "htdocs/"
              , dropWhile (== '/') resource
              , if last resource == '/' then "index.html" else ""
              ]
        hPutStr h "HTTP/1.1 200 OK\r\n\r\n"
        hPutStr h =<< readFile path
        hClose h
      _ -> error "todo"
DiazCarrete, to vim
@DiazCarrete@hachyderm.io avatar

9.1 released, including support for classes in Vimscript! Now I can finally adopt it as my my primary programming language. (Just kidding, of course... It already was.)
🔗 https://www.vim.org/vim-9.1-released.php
🔗 https://vimhelp.org/vim9class.txt.html#vim9-class

jaror,
jaror avatar

@DiazCarrete with type classes in Haskell my personal ideology is to avoid them unless you're very sure that they are really a good model of your domain and they have specific laws. But indeed, many classes and instances - in base even - don't satisfy that.

jaror, to haskell
jaror avatar

Are you noticing stutters while using an interactive application like gloss in GHCi? Try the non-moving GC, e.g.

ghci +RTS --nonmoving-gc -RTS
cabal-repl --repl-options="+RTS --nonmoving-gc -RTS"

https://gitlab.haskell.org/ghc/ghc/-/issues/24416

jaror,
jaror avatar

And for more GHCi performance options see: https://stackoverflow.com/a/77895561/15207568

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