Skip to content

Instantly share code, notes, and snippets.

View nsanmartin's full-sized avatar

Nicolás San Martín nsanmartin

View GitHub Profile
@nsanmartin
nsanmartin / propol.hs
Created March 30, 2023 03:05
propositional logic parser using Parsec
import System.IO
import Control.Monad
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Language
import qualified Text.ParserCombinators.Parsec.Token as Token
data Formula = Or Formula Formula
| And Formula Formula
| Impl Formula Formula
@nsanmartin
nsanmartin / sort-w3m-bookmarks.hs
Last active March 25, 2023 14:59
Sort w3m bookmarks
-- Reads from stdin (one or more) html with w3m bookmars,
-- parse them and merges them joining sections with the same
-- name and removing duplicate bookmarks for a given section
-- (where two bookmars are the same if they have the same url
-- and text).
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
import Control.Monad ((>>), (>>=), mapM)