Skip to content

Instantly share code, notes, and snippets.

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
module Main where
import Control.Monad
import System.Environment
main = do
args <- getArgs
if null args
then mainCli
else mainArgs args
{-# LANGUAGE MultiParamTypeClasses #-}
module Main where
import Control.Monad
import System.IO
import System.IO.Temp
import Database.HDBC
import Database.HDBC.Sqlite3
use_module(library(regex)).
% https://www.haskell.org/onlinereport/haskell2010/haskellch10.html
%module → module modid [exports] where body
% | body
expr --> ["module", modid, "where", body].
modid --> [MODID, {modid(MODID)}].
modid(MODID) :- condid(MODID).
conid(CONID) :- regex('([A-Z][A-Za-z0-9\']*)', [], CONID, []).
body(BODY) :- true.
@janesser
janesser / navigation.pl
Created December 22, 2016 00:27
navigation tree with prolog
child(n1, [n11, n12]).
child(n11, [c11, c2]).
child(n12, [c11]).
child(c1, [c11, c12]).
child(c11, [p111, p112]).
child(c12, [p112]).
% distributive
is_child(A, B) :- child(A,KIDS), member(B, KIDS).