ftcqueue: FTC Queue

[ bsd3, data, library, unclassified ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5) [details]
License BSD-3-Clause
Copyright (c) 2025 Yoshikuni Jujo
Author Yoshikuni Jujo
Maintainer yoshikuni.jujo@gmail.com
Category Data
Home page https://github.com/YoshikuniJujo/ftcqueue#readme
Bug tracker https://github.com/YoshikuniJujo/ftcqueue/issues
Source repo head: git clone https://github.com/YoshikuniJujo/ftcqueue
Uploaded by YoshikuniJujo at 2025-11-07T03:26:27Z
Distributions
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-11-07 [all 1 reports]

Readme for ftcqueue-0.1.0.1

[back to package description]

ftcqueue

See

https://okmij.org/ftp/Haskell/zseq.pdf

Sample Code

module Main (main) where

import Data.Time
import Data.FTCQueue

import Lib

main :: IO ()
main = foo `apply` ()

foo :: Q IO () ()
foo = singleton (const getLine) |> addTime |> putStrLn

addTime :: String -> IO String
addTime msg = do
	ct <- getCurrentTime
	pure $ msg ++ " (" ++ show ct ++ ")"

apply :: Monad t => Q t a b -> a -> t b
q `apply` x = case viewl q of
	One f -> f x
	f :| q' -> f x >>= (q' `apply`)