HTMell-0.1.0.0: Minimal filesystem powered markdown content management system
Copyright(c) 2021-2022 Mirko Westermeier
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

HTMell.Util

Description

Useful utility functions.

Synopsis

Content trees

pathParts :: String -> [String] #

Splits a given content address string in its single path parts.

pathParts "/foo/bar/baz" == ["foo", "bar", "baz"]

splitNodePath :: String -> (Integer, String) #

Splits a given file or directory name in ord Integer and name, if it has a leading number, followed by "_". The extension is stripped.

splitNodePath "42_foo.bar" == (42, "foo")
splitNodePath "foo" == (0, "foo")

Content

data PseudoContent #

Trivial pseudo content, useful for testing only.

Constructors

PseudoContent 

Instances

Instances details
Eq PseudoContent # 
Instance details

Defined in HTMell.Util

Show PseudoContent # 
Instance details

Defined in HTMell.Util

HTMellContent PseudoContent # 
Instance details

Defined in HTMell.Util

cempty :: Maybe PseudoContent #

An empty PseudoContent value, useful for testing only.

Other stuff

compose :: [a -> a] -> a -> a #

Composes a list of composable functions:

\[ [f_1,f_2,...,f_n] \;\mapsto\; f_1 \circ f_2 \circ \cdots \circ f_n \qquad\mbox{for}\qquad f_i: a \to a \; \forall\;i \,;\;\; a\mbox{ any type.} \]