cutsea110
だがapt searchしても見当らないのであった.
ghc
のバイナリインストールなら最近は ghcup
がオススメです.ghcup
[Network.Simple.TCP.TLS]()
というパッケージで以下のようなコードを実行させてchromeでhttpsでアクセスするとスレッドが残ったままになってしまいます(Firefox、Safariでは起こらない)。{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Lib ( someFunc ) where import Control.Concurrent import Control.Monad import Data.X509.CertificateStore import Network.Simple.TCP.TLS import Network.TLS someFunc :: IO () someFunc = do credentialLoadX509 "./localhost.pem" "./localhost-key.pem" >>= \case Right c -> void $ forkIO $ serve (makeServerSettings c Nothing) "localhost" "8080" $ \(ctx, _) -> establish ctx _ -> putStrLn "Error" -- 終了させないためだけの処理 _ <- getLine pure () establish :: Context -> IO () establish ctx = do r <- recv ctx case r of Just r' -> print r' _ -> pure ()
0 MyI# 0# IBI# 0# 1729382256910270464 MyI# 1729382256910270464# CB 10 CB CA CA
+9 (アラインメントしていない場所)からの8バイト、というのがすごく気持ち悪いです… intel だから読めるけどそれ以外のアーキテクチャだったらアラインメントエラーになるのでは、という感が
find . -type f -name "*hs" …その他の絞り込み条件… -print0 | xargs -0 stylish-haskell -i
のように find の -print0 オプションと xargs の -0 オプションのコンボを使うとどんな変な文字が含まれていても大丈夫になりますfind . -type f -name "*hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i
stylish-haskell -i **/*.hs
だけで行けるんですけどね^^;)==================== Grand total simplifier statistics ==================== Total ticks: 15 6 PreInlineUnconditionally 2 x 2 x 2 y 1 PostInlineUnconditionally 1 x' 2 UnfoldingDone 2 timesInt 1 LetFloatFromLet 1 4 BetaReduction 2 x 2 y 1 KnownBranch 1 wild 3 SimplifierDone 3 : : ==================== CorePrep ==================== Result size of CorePrep = {terms: 53, types: 26, coercions: 0, joins: 0/0} -- RHS size: {terms: 15, types: 7, coercions: 0, joins: 0/0} timesInt :: Int -> Int -> Int timesInt = \ (x :: Int) (y :: Int) -> case x of { I# x' -> case y of { I# y' -> case *# x' y' of sat { __DEFAULT -> I# sat } } } -- RHS size: {terms: 22, types: 9, coercions: 0, joins: 0/0} cube :: Int -> Int cube = \ (x :: Int) -> case x of wild { I# x' -> case wild of wild1 { I# y' -> case wild1 of { I# y'1 -> case *# x' y' of sat { __DEFAULT -> case *# sat y'1 of sat { __DEFAULT -> I# sat } } } } }
==================== Grand total simplifier statistics ==================== Total ticks: 17 4 PreInlineUnconditionally 2 x 2 y 3 PostInlineUnconditionally 2 y' 1 x' 2 UnfoldingDone 2 timesInt 1 LetFloatFromLet 1 4 BetaReduction 2 x 2 y 3 KnownBranch 2 wild 1 wild 9 SimplifierDone 9 : : ==================== CorePrep ==================== Result size of CorePrep = {terms: 47, types: 22, coercions: 0, joins: 0/0} -- RHS size: {terms: 15, types: 7, coercions: 0, joins: 0/0} timesInt :: Int -> Int -> Int timesInt = \ (x :: Int) (y :: Int) -> case x of { I# x' -> case y of { I# y' -> case *# x' y' of sat { __DEFAULT -> I# sat } } } -- RHS size: {terms: 16, types: 5, coercions: 0, joins: 0/0} cube :: Int -> Int cube = \ (x :: Int) -> case x of { I# x' -> case *# x' x' of sat { __DEFAULT -> case *# sat x' of sat { __DEFAULT -> I# sat } } }
==================== Grand total simplifier statistics ==================== Total ticks: 1 1 LetFloatFromLet 1 2 SimplifierDone 2 : : ==================== CorePrep ==================== Result size of CorePrep = {terms: 39, types: 19, coercions: 0, joins: 0/1} -- RHS size: {terms: 15, types: 7, coercions: 0, joins: 0/0} timesInt :: Int -> Int -> Int timesInt = \ (x :: Int) (y :: Int) -> case x of { I# x' -> case y of { I# y' -> case *# x' y' of sat { __DEFAULT -> I# sat } } } -- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/1} cube :: Int -> Int cube = \ (x :: Int) -> let { sat :: Int sat = timesInt x x } in timesInt sat x
==================== Grand total simplifier statistics ==================== Total ticks: 28 8 PreInlineUnconditionally 3 w 3 w 1 x 1 y 6 PostInlineUnconditionally 2 ww 1 x' 1 y' 1 ww 1 ww 2 UnfoldingDone 2 timesInt 1 LetFloatFromLet 1 1 EtaReduction 1 ww 4 BetaReduction 2 w 2 w 6 KnownBranch 2 ww 1 wild 1 wild 1 ww 1 ww 9 SimplifierDone 9 : : ==================== CorePrep ==================== Result size of CorePrep = {terms: 53, types: 27, coercions: 0, joins: 0/0} -- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0} $wtimesInt :: Int# -> Int# -> Int# $wtimesInt = \ (eta :: Int#) (eta :: Int#) -> *# eta eta -- RHS size: {terms: 15, types: 7, coercions: 0, joins: 0/0} timesInt :: Int -> Int -> Int timesInt = \ (w :: Int) (w1 :: Int) -> case w of { I# ww1 -> case w1 of { I# ww3 -> case $wtimesInt ww1 ww3 of ww4 { __DEFAULT -> I# ww4 } } } -- RHS size: {terms: 16, types: 5, coercions: 0, joins: 0/0} cube :: Int -> Int cube = \ (x :: Int) -> case x of { I# ww1 -> case $wtimesInt ww1 ww1 of ww2 { __DEFAULT -> case $wtimesInt ww2 ww1 of ww3 { __DEFAULT -> I# ww3 } } }