Haskell: read input character from console immediately, not after newline

Yes, it’s a bug. Here’s a workaround to save folks clicking and scrolling: {-# LANGUAGE ForeignFunctionInterface #-} import Data.Char import Foreign.C.Types getHiddenChar = fmap (chr.fromEnum) c_getch foreign import ccall unsafe “conio.h getch” c_getch :: IO CInt So you can replace calls to getChar with calls to getHiddenChar. Note this is a workaround just for ghc/ghci … Read more

Make GHC only type-check?

What about ghc -fno-code file.hs. It will generate no other files and will show errors if your files don’t typecheck. Caveat: this will not do analysis on in-exhaustive pattern matches, so if you want those additional useful warnings, don’t use this option alone.

Is there a list of GHC extensions that are considered ‘safe’?

It’s probably best to look at what SafeHaskell allows: Safe Language The Safe Language (enabled through -XSafe) restricts things in two different ways: Certain GHC LANGUAGE extensions are disallowed completely. Certain GHC LANGUAGE extensions are restricted in functionality. Below is precisely what flags and extensions fall into each category: Disallowed completely: GeneralizedNewtypeDeriving, TemplateHaskell Restricted functionality: … Read more

Debugging a memory leak that doesn’t show on heap profiling

While I am not familiar with Haskell daemon itself, answering your question “how it’d be possible to more effectively pinpoint such a leak”, it might be possible to use valgrind –leak-check=yes haskelldaemon (better if you compile it with debug info), OR, if the leak happens in shared library, try LD_PRELOAD=”yourlibrary.so” valgrind your-executable.

What is Haskell missing for totality checking?

Liquid Haskell has totality checking: https://github.com/ucsd-progsys/liquidhaskell#termination-check By default a termination check is performed on all recursive functions. Use the no-termination option to disable the check liquid –no-termination test.hs In recursive functions the first algebraic or integer argument should be decreasing. The default decreasing measure for lists is length and Integers its value. (I included screenshot … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)