Skip to content

Commit

Permalink
Update libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Dec 22, 2024
1 parent 09e09e2 commit eecc3dd
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 26 deletions.
4 changes: 4 additions & 0 deletions docs/developers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 📅 Revision history for HelCT

## 0.1.0.1 -- 2024-12-22

* Update libraries

## 0.1.0.0 -- 2020-05-09

* First version. Released on an unsuspecting world.
Expand Down
2 changes: 1 addition & 1 deletion docs/reports/helct/HelVM-HelCT-HelCT.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>HelVM.HelCT.HelCT</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">HelVM.HelCT.HelCT</p></div><div id="interface"></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>HelVM.HelCT.HelCT</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">HelVM.HelCT.HelCT</p></div><div id="interface"></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.28.0</p></div></body></html>
2 changes: 1 addition & 1 deletion docs/reports/helct/doc-index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages (Index)</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages (Index)</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.28.0</p></div></body></html>
2 changes: 1 addition & 1 deletion docs/reports/helct/haddock-bundle.min.js

Large diffs are not rendered by default.

Binary file modified docs/reports/helct/helct.haddock
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/reports/helct/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="description"><h1>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</h1><div class="doc"><p>Please see the README on GitHub at <a href="https://github.com/helvm/helct#readme">https://github.com/helvm/helct#readme</a></p></div></div><div id="module-list"><p class="caption">Modules</p><ul><li><span class="module details-toggle-control details-toggle" data-details-id="n.1">HelVM</span><details id="n.1" open="open"><summary class="hide-when-js-enabled">Submodules</summary><ul><li><span class="module details-toggle-control details-toggle" data-details-id="n.1.1">HelCT</span><details id="n.1.1" open="open"><summary class="hide-when-js-enabled">Submodules</summary><ul><li><span class="module"><span class="noexpander">&nbsp;</span><a href="HelVM-HelCT-HelCT.html">HelVM.HelCT.HelCT</a></span></li></ul></details></li></ul></details></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="description"><h1>helct-0.1.0.0: HELCT - Heavenly Esoteric Little C Transpiler to Esoteric Languages</h1><div class="doc"><p>Please see the README on GitHub at <a href="https://github.com/helvm/helct#readme">https://github.com/helvm/helct#readme</a></p></div></div><div id="module-list"><p class="caption">Modules</p><div id="module-list"><p class="caption">helct-0.1.0.0</p><ul><li><span class="module details-toggle-control details-toggle" data-details-id="n.1">HelVM</span><details id="n.1" open="open"><summary class="hide-when-js-enabled">Submodules</summary><ul><li><span class="module details-toggle-control details-toggle" data-details-id="n.1.1">HelCT</span><details id="n.1.1" open="open"><summary class="hide-when-js-enabled">Submodules</summary><ul><li><span class="module"><span class="noexpander">&nbsp;</span><a href="HelVM-HelCT-HelCT.html">HelVM.HelCT.HelCT</a></span></li></ul></details></li></ul></details></li></ul></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.28.0</p></div></body></html>
4 changes: 4 additions & 0 deletions docs/reports/helct/linuwial.css
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ table.info {
background: url(synopsis.png) no-repeat -75px -8px;
}

#synopsis details:not([open]) > ul {
visibility: hidden;
}

#synopsis ul {
height: 100%;
overflow: auto;
Expand Down
2 changes: 1 addition & 1 deletion docs/reports/helct/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"haddock_version":"2.24.2"}
{"haddock_version":"2.28.0"}
1 change: 0 additions & 1 deletion docs/reports/helct/quick-jump.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
left: calc(50% - 22em);
width: 44em;
z-index: 1000;
pointer-events: none;
overflow-y: auto;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/reports/stan.html

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions helct.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ extra-source-files:
docs/developers/CHANGELOG.md
docs/README.md

tested-with: GHC == 9.0.1
tested-with: GHC == 9.10.1

source-repository head
type: git
location: https://github.com/helvm/helct

common common-options
build-depends:
base < 4.16
, relude == 1.0.0.1
base < 4.21
, relude == 1.2.2.0
mixins:
base hiding (Prelude)
, relude (Relude as Prelude, Relude.Extra, Data.Text)
Expand Down Expand Up @@ -130,13 +130,17 @@ test-suite helct-test
hs-source-dirs: hs/test
main-is: Main.hs
other-modules:
Slow
Spec
build-depends:
hspec
, hspec-core
, hspec-expectations-pretty-diff
, hspec-golden
, hspec-slow
, mtl
, stm
, time

, helct

Expand All @@ -146,17 +150,17 @@ test-suite helct-test
-rtsopts
-with-rtsopts=-N

benchmark helct-benchmark
import: common-options
type: exitcode-stdio-1.0
hs-source-dirs: hs/benchmark
main-is: Main.hs
build-depends:
gauge
--benchmark helct-benchmark
-- import: common-options
-- type: exitcode-stdio-1.0
-- hs-source-dirs: hs/benchmark
-- main-is: Main.hs
-- build-depends:
-- gauge

-- , helct

ghc-options:
-threaded
-rtsopts
-with-rtsopts=-N
-- ghc-options:
-- -threaded
-- -rtsopts
-- -with-rtsopts=-N
8 changes: 3 additions & 5 deletions hs/test/Main.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module Main where

import Slow
import qualified Spec
import Test.Hspec (hspec)
import Test.Hspec.Slow
import Test.Hspec (hspec)

main :: IO ()
main = do
config <- configure 1
hspec $ timeThese config Spec.spec
main = (hspec . flip timeThese Spec.spec) =<< configure 1
82 changes: 82 additions & 0 deletions hs/test/Slow.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RankNTypes #-}

module Slow (
configure,
timedHspec,
timedHspecParallel,
timeThese
) where

import Control.Concurrent.STM.TVar hiding (newTVarIO, readTVarIO)
import Data.Time.Clock
import Test.Hspec
import Test.Hspec.Core.Spec

type SlowResults = [(String, NominalDiffTime)]
type SlowResultTracker = TVar SlowResults

data SlowConfiguration = SlowConfiguration {
duration :: !Int,
tracker :: !SlowResultTracker
}

configure :: Int -> IO SlowConfiguration
configure x =
newTVarIO [] >>= \t ->
return (SlowConfiguration x t)

stopwatch :: MonadIO m => m a -> m (a, NominalDiffTime)
stopwatch x = do
start <- liftIO getCurrentTime
!a <- x
end <- liftIO getCurrentTime
return (a, end `diffUTCTime` start)

trackedAction :: MonadIO m => String -> m a -> ReaderT SlowConfiguration m a
trackedAction s m = do
conf <- ask
(result, d) <- lift (stopwatch m)
if d > (realToFrac . duration $ conf)
then do
liftIO $ atomically $ modifyTVar (tracker conf) (++ [(s, d)])
return result
else return result

type Timer = forall m a. (MonadIO m, Example (m a)) => String -> m a -> SpecWith (Arg (m a))

timed :: SlowConfiguration -> Timer
timed c s a = it s $ runReaderT (trackedAction s a) c

slowReport :: (MonadIO m) => SlowConfiguration -> m ()
slowReport s = do
liftIO $ do
slows <- readTVarIO (tracker s)
putStrLn "Slow examples:"
mapM_ (\(t, v) -> putStrLn $ show v ++ ": " ++ t) slows

timedHspec :: SlowConfiguration -> (Timer -> SpecWith ()) -> IO ()
timedHspec t x = hspec $ (afterAll_ . slowReport) t $ x (timed t)

timedHspecParallel :: SlowConfiguration -> (Timer -> SpecWith ()) -> IO ()
timedHspecParallel t x = hspec $ (afterAll_ . slowReport) t $ parallel $ x (timed t)

-- | times all tests without having to use a custom `it` function
timeThese :: SlowConfiguration -> SpecWith a -> SpecWith a
timeThese config = afterAll_ (slowReport config) . mapSpecItem_ (modifyAroundAction $ adhocMeasure config)

adhocMeasure :: SlowConfiguration -> Item a -> (a -> IO ()) -> a -> IO ()
adhocMeasure config item theTestF a = runReaderT (trackedAction (makeDescription item) $ theTestF a) config

makeDescription :: Item a -> String
makeDescription item = defaultDescription (itemLocation item) <> "\n\t" <>
itemRequirement item

defaultDescription :: Maybe Location -> String
defaultDescription stack = fromMaybe ("source location not found: " <> show stack) $ do
Location locationFile locationLine locationColumn <- stack
pure (locationFile ++ "[" ++ show locationLine ++ ":" ++ show locationColumn ++ "]")

modifyAroundAction :: (Item a -> ActionWith a -> ActionWith b) -> Item a -> Item b
modifyAroundAction action item@Item{itemExample = e} =
item{ itemExample = \params aroundAction -> e params (aroundAction . action item) }

0 comments on commit eecc3dd

Please sign in to comment.