Universal ctags can be extended to
generate tags for Happy and Alex macros.
ghc-tags
can already handle
functions and types defined therein.
Put the following in ~/.ctags.d/alex.ctags
:
--langdef=ALEX
--langmap=ALEX:.x
module Graph where | |
import qualified Data.Array as A | |
import Data.List (find, inits) | |
type J r x = (x -> r) -> x | |
data R = Dist Integer | |
| Infinity deriving Eq |
-- cypm add fl-parser | |
-- ported from: https://www-ps.informatik.uni-kiel.de/~cpm/DOC/fl-parser-3.0.0/Parser_curry.html | |
import Parser | |
num = Parser.some digit l >>> numeric_value l | |
where l free | |
numeric_value ds = foldl1 (\acc x -> 10*acc+x) (map (\c -> ord c-ord '0') ds) | |
expr = term m Parser.<*> terminal '+' Parser.<*> expr n >>> m+n | |
<||> term m Parser.<*> terminal '-' Parser.<*> expr n >>> m-n |
NB. I used https://towardsdatascience.com/implementing-the-xor-gate-using-backpropagation-in-neural-networks-c1f255b4f20d | |
NB. input data | |
X =: 4 2 $ 0 0 0 1 1 0 1 1 | |
NB. target data, ~: is 'not-eq' aka xor | |
Y =: , (i.2) ~:/ (i.2) | |
scale =: (-&1)@:(*&2) |