Search
1000 results for “haskell”
-
Почему я перестал писать bash-скрипты и написал свой язык
Время от времени мне нужно выполнить примитивный сценарий в терминале, но каждый раз это заканчивается очередным гуглежом «bash iterate each file» или «bash file has string». А что если скрипты в терминале можно было бы писать прямо как поток декларативных мыслей?
https://habr.com/ru/articles/1020728/
#скриптовый_язык #bash #функциональное_программирование #REPL #автоматизация #open_source #Rust #Lisp #Haskell
-
Почему я перестал писать bash-скрипты и написал свой язык
Время от времени мне нужно выполнить примитивный сценарий в терминале, но каждый раз это заканчивается очередным гуглежом «bash iterate each file» или «bash file has string». А что если скрипты в терминале можно было бы писать прямо как поток декларативных мыслей?
https://habr.com/ru/articles/1020728/
#скриптовый_язык #bash #функциональное_программирование #REPL #автоматизация #open_source #Rust #Lisp #Haskell
-
I have a working prototype of an #ASN1 to #Haskell compiler. It can't do a lot yet; but it does translate enum types.
(Built on top of a lot of great existing work.)
```
ghci> Prelude.putStr =<< Prelude.readFile "./asn1-modules/bar.asn1"
BarFramework { 1 }DEFINITIONS ::=
BEGINBar ::= ENUMERATED {red, blue, yellow}
END -- BarFramework
ghci> _ = () ; $(spliceFromModuleOrDie "./asn1-modules/bar.asn1")
ghci> :i Bar
type Bar :: *
data Bar = Red | Blue | Yellow
-- Defined at <interactive>:137:11
ghci>
``` -
I have a working prototype of an #ASN1 to #Haskell compiler. It can't do a lot yet; but it does translate enum types.
(Built on top of a lot of great existing work.)
```
ghci> Prelude.putStr =<< Prelude.readFile "./asn1-modules/bar.asn1"
BarFramework { 1 }DEFINITIONS ::=
BEGINBar ::= ENUMERATED {red, blue, yellow}
END -- BarFramework
ghci> _ = () ; $(spliceFromModuleOrDie "./asn1-modules/bar.asn1")
ghci> :i Bar
type Bar :: *
data Bar = Red | Blue | Yellow
-- Defined at <interactive>:137:11
ghci>
``` -
I have a working prototype of an #ASN1 to #Haskell compiler. It can't do a lot yet; but it does translate enum types.
(Built on top of a lot of great existing work.)
```
ghci> Prelude.putStr =<< Prelude.readFile "./asn1-modules/bar.asn1"
BarFramework { 1 }DEFINITIONS ::=
BEGINBar ::= ENUMERATED {red, blue, yellow}
END -- BarFramework
ghci> _ = () ; $(spliceFromModuleOrDie "./asn1-modules/bar.asn1")
ghci> :i Bar
type Bar :: *
data Bar = Red | Blue | Yellow
-- Defined at <interactive>:137:11
ghci>
``` -
I have a working prototype of an #ASN1 to #Haskell compiler. It can't do a lot yet; but it does translate enum types.
(Built on top of a lot of great existing work.)
```
ghci> Prelude.putStr =<< Prelude.readFile "./asn1-modules/bar.asn1"
BarFramework { 1 }DEFINITIONS ::=
BEGINBar ::= ENUMERATED {red, blue, yellow}
END -- BarFramework
ghci> _ = () ; $(spliceFromModuleOrDie "./asn1-modules/bar.asn1")
ghci> :i Bar
type Bar :: *
data Bar = Red | Blue | Yellow
-- Defined at <interactive>:137:11
ghci>
``` -
Anyone using the brick #Haskell library and what to shore hints / lecture me about how to test functions that "live in" `EventM` ?
In particular, I'd like to be able to take an initial state (generated in whole or part randomly) feed some events (mainly keystrokes) in an then validate the final state. But, maybe I'm thinking about it all wrong.
The rendering functions are "easy enough" to test, but I feel like most of the real "logic" is in the event handling.
-
Anyone using the brick #Haskell library and what to shore hints / lecture me about how to test functions that "live in" `EventM` ?
In particular, I'd like to be able to take an initial state (generated in whole or part randomly) feed some events (mainly keystrokes) in an then validate the final state. But, maybe I'm thinking about it all wrong.
The rendering functions are "easy enough" to test, but I feel like most of the real "logic" is in the event handling.
-
Anyone using the brick #Haskell library and what to shore hints / lecture me about how to test functions that "live in" `EventM` ?
In particular, I'd like to be able to take an initial state (generated in whole or part randomly) feed some events (mainly keystrokes) in an then validate the final state. But, maybe I'm thinking about it all wrong.
The rendering functions are "easy enough" to test, but I feel like most of the real "logic" is in the event handling.
-
Anyone using the brick #Haskell library and what to shore hints / lecture me about how to test functions that "live in" `EventM` ?
In particular, I'd like to be able to take an initial state (generated in whole or part randomly) feed some events (mainly keystrokes) in an then validate the final state. But, maybe I'm thinking about it all wrong.
The rendering functions are "easy enough" to test, but I feel like most of the real "logic" is in the event handling.
-
I recently learned about higher kinded data (HKD) using the barbies library. barbies-th adds some helpers to make the usage easier. However I have a hard time understanding how to use the AccessorsB, LensB, getLensB type classes / functions. Can anyone point me to an example?
-
Implementation of the Bellman's rule "What I tell you three times is true" (from Lewis Carroll's "The Hunting of the Snark", 1876). The #Haskell code is here: https://snrk.de/truth-isnt-truth/
This is a great tool for fact checking.
This is a great tool for fact checking.
This is a great tool for fact checking.#TheHuntingOfTheSnark, #LewisCarroll, #WhatITellYouThreeTimesIsTrue, #BellmansRule, #thrice, #threeTimes, #truth, #facts, #assertion, #assertiveness, #proof, #FactChecking
-
@Frohmann Die letzten guten Sachbücher waren #HaskellInDepth von #VitalyBragilevsky (Manning), #TractatusLogicoPhilosophicus (re-read) von #LudwigWittgenstein, #TheJoyOfAbstraction von @DrEugeniaCheng, #TheTimelessWayOfBuilding von #ChristopherAlexander und #TheArtOfGameDesign von #JesseSchell.
Das letzte gute Fiktionale ist leider schon eine kleine Ewigkeit her: #MasonAndDixon von #ThomasEPynchon.
-
@Frohmann Die letzten guten Sachbücher waren #HaskellInDepth von #VitalyBragilevsky (Manning), #TractatusLogicoPhilosophicus (re-read) von #LudwigWittgenstein, #TheJoyOfAbstraction von @DrEugeniaCheng, #TheTimelessWayOfBuilding von #ChristopherAlexander und #TheArtOfGameDesign von #JesseSchell.
Das letzte gute Fiktionale ist leider schon eine kleine Ewigkeit her: #MasonAndDixon von #ThomasEPynchon.
-
@Frohmann Die letzten guten Sachbücher waren #HaskellInDepth von #VitalyBragilevsky (Manning), #TractatusLogicoPhilosophicus (re-read) von #LudwigWittgenstein, #TheJoyOfAbstraction von @DrEugeniaCheng, #TheTimelessWayOfBuilding von #ChristopherAlexander und #TheArtOfGameDesign von #JesseSchell.
Das letzte gute Fiktionale ist leider schon eine kleine Ewigkeit her: #MasonAndDixon von #ThomasEPynchon.
-
Context free grammars (CFG) are better than parsing expression grammars (PEG), because CFGs represent how we think.
Parser combinators are similar to PEGs, so they are worse than CFGs, too.
So, don't use Rust libraries
nom,combine. Uselalrpop.Don't use Haskell libraries
parsec,gigaparsec,attoparsec,megaparsec,trifecta. UseEarley,happy.See more detailed story in my new article https://safinaskar.writeas.com/this-is-why-you-should-never-use-parser-combinators-and-peg .
The story also includes some cases, where PEG and parser combinators may still be useful. Also, the article gives links to my Haskell parsing libraries.
#haskell #rust #parsing #parse #cfg #peg #combinators #parsercombinators #parsingcombinators #nom #combine #lalrpop #parsec #earley #happy
-
-
The folks at #Kattis finally published the problems from a bunch of old #competitiveprogramming contests that they have hosted over the years, including quite a few that I helped organize. Yay! (I have been bugging them to do this literally for years.) In particular, the list of available problems written by me instantly went from 2 to about 35:
https://open.kattis.com/problem-authors/Brent%20Yorgey
I have solved many (though not all) of them in #Haskell. Give them a try and let me know what you think! 😄
-
Turned my #zurihac2025 talk on #competitiveprogramming in #Haskell into an expanded blog post:
https://byorgey.github.io/blog/posts/2025/06/10/comprog-hs-intro.html
-
Funxy — гибридный язык программирования со статической типизацией
Funxy — гибридный язык программирования со статической типизацией, pattern matching и удобной работой с бинарными данными. Для чего подходит Скрипты и автоматизация. Один бинарник без зависимостей — скачал и работает. Встроенная работа с файлами, JSON, HTTP, SQL. Небольшие приложения. CLI-утилиты, API-сервисы, обработка данных. Работа с бинарными данными. Парсинг на уровне отдельных битов. Сетевые протоколы, форматы файлов, нестандартные структуры. Обучение программированию. Простой синтаксис, но с важными концепциями: типы, pattern matching, иммутабельные структуры данных, рекурсия с TCO (можно писать рекурсивный код без страха переполнения стека).
https://habr.com/ru/articles/974674/
#haskell #monad #tco #скриптовый_язык #разработка_языков_программирования #функциональное_программирование #рекурсия #matching #bitstring #http
-
Parser combinators in #Haskell are like the cool kids at school 🎓, effortlessly solving Advent of Code problems while #regexes are stuck in detention 🚫. Who knew regexes were still a thing in 2025? 😂 In Haskell, we leave those relics to flounder in the past while we flex our combinator muscles 💪.
https://entropicthoughts.com/parser-combinators-beat-regexes #ParserCombinators #AdventOfCode #FutureCoding #Flexibility #HackerNews #ngated -
I just published a post on an interesting MSc thesis I supervised. Arvid Rydberg and Selina Sand Engberg took on the computational challenge of level-p-complexity (D_p(f)) of Boolean functions.
They optimised the algorithms using hash-consing & normalisation, and developed tools for exact calculations using algebraic numbers.
Details:
https://patrikja.owlstown.net/posts/4554#Haskell #CompSci #BooleanLogic
I presented earlier work (from before this MSc thesis) at ICFP 2024: https://www.youtube.com/watch?v=mxDjPTDwbGE
-
The #Haskell Cryptography Group calls for early adopters of its #libsodium, #botan and one-time-password libraries! https://discourse.haskell.org/t/call-for-early-adopters-of-sel-botan-and-one-time-password/9326
-
🧙♂️✨Welcome to the magical world where #Haskell and #Swift somehow "talk," all wrapped up in a shiny #XCFramework package!📦🔧 Follow this riveting tale of dependency hell, where tech wizards tackle marshalling and the foreign function interface—because who needs simple, right? 😂🌀
https://alt-romes.github.io/posts/2025-07-05-packaging-a-haskell-library-as-a-swift-binary-xcframework.html #DependencyHell #TechWizards #HackerNews #ngated -
Error messages should be independent. If you solve the underlying issue of one, it should not also solve another error message. Reporting multiple errors with the same underlying cause will just overload your users.
I think that's what's happening here: https://stackoverflow.com/q/79816819/15207568. You can solve 4/5 errors by just adding an extra argument to the `foldr` call.
-
Check all that you consider functions in Haskell. (The question is not whether you believe these exist in Haskell (all 4 do), but rather which ones (according to your opinion / your terminology use) are to be considered to be "functions".)
-
🍕💻 Ah yes, the existential crisis of programming languages: do you need to understand #Haskell to grasp their 'lil' quirks, or can you just wing it with your pancreas? 🙃 Spoiler: It's all the same lexing, parsing, and desugaring nonsense, just with a sprinkle of pretentiousness to make you feel like you're doing something revolutionary. 🚀
https://taylor.town/scrapscript-001 #programminglanguages #existentialcrisis #codinghumor #techsatire #lexingparsing #HackerNews #ngated -
Any other #haskell devs out there doing #rustlang in the meantime?
I use it for 1y now in day job (and toy projs as well).
#frunk , #typenum , #uom crates helped me a lot to get a "better feel" for the type system, f.e. implementing type functions (aka families) with traits+assoc types.
But still often in the situation where in #haskell land i'd blindly grab into toolbox and grab f.e. a GADT + a tranformer stack, where in #rustlang I am sometimes struggle "how to" in #rustlang type-system.
-
CW: :haskell:, конструкція where
Окрім виразу
let inє ще схожа конструкціяwhere. Вона виконує ту ж функцію, але трохи по інакшому.g n = x+2*x where x = n^3+2На перший погляд, змінилась тільки послідовність оголошення та використання функцій, і це майже правильно. Ключова відмінність у, тому що
let inце вираз, аwhereконструкція. Тому друге можна використовувати там де не можна перше, наприклад при використанні кількох визначень з охоронними виразами чи зіставленнями.f x | x > 0 = y * 2 | x < 0 = y / 2 where y = cos x^2На жаль приклад дуже не дуже, але є що є.
Тут оголошені функції після
whareможна використовувати в усіх визначенняхf, й навіть в охоронних виразах.let inтакого не дозволяє.#ukrhaskell #haskell #where #letin #вираз #конструкція #підфункції #охоронні_вирази #програмування