This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% -*-Prolog-*- | |
:- module(d01, [ | |
a/0, | |
b/0 | |
]). | |
:- use_module(library(pio)). | |
:- use_module(library(dcg/basics)). | |
a :- | |
phrase_from_file(lists(L1, L2), '1/inputa.txt'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
amb_example(BestGuess) :- | |
run_with_monte_carlo_amb(1000, | |
( amb(BestGuess, [2,3,4,5,6,7,8,9,10,11,12]), | |
guess_the_dice_total(BestGuess) | |
)). | |
guess_the_dice_total(Total) :- | |
random_member(Dice1, [1,2,3,4,5,6]), | |
random_member(Dice2, [1,2,3,4,5,6]), | |
(Total =\= Dice1 + Dice2 -> amb(fail); true). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- modified version of https://package.elm-lang.org/packages/dvberkel/microkanren/latest/ | |
-- fixing a bug, and adding reification, some practical features, and an example logic problem | |
module MicroKanren.Kernel exposing | |
( Goal, State, Stream(..), Term(..), Var | |
, callFresh, conjoin, disjoin | |
, emptyState, unit | |
, walk | |
, Substitutions, fish, l, pull, unify, v | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Browser.Dom | |
import Element exposing (Element) | |
import Element.Background as Background | |
import Element.Border as Border | |
import Element.Font as Font | |
import Element.Input as Input | |
import Html | |
import Html.Attributes | |
import Html.Events | |
import Json.Decode as Decode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (..) | |
import Browser | |
import Html exposing (Html, button, div, span, text) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
import Timeline exposing (Timeline) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Base.ListSet exposing | |
( Set | |
, diff | |
, empty | |
, filter | |
, foldl | |
, foldr | |
, fromList | |
, group | |
, insert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input [ | |
focus (item.id) (RequiresFocus_ Nothing) | |
else | |
none | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Stopwatch | |
import Html exposing (..) | |
import Html.App as App | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
main: Program Never | |
main = | |
App.program | |
{ init = init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TimeApp ( start, Config, App ) where | |
{-| This module helps you start your application in a typical Elm workflow. | |
It assumes you are following [the Elm Architecture][arch] and using | |
[elm-effects][]. From there it will wire everything up for you! | |
**Be sure to [read the Elm Architecture tutorial][arch] to learn how this all | |
works!** | |
[arch]: https://github.com/evancz/elm-architecture-tutorial | |
[elm-effects]: http://package.elm-lang.org/packages/evancz/elm-effects/latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
type Action | |
= NoOp | |
| EditEntry Entry String | |
type alias Entry = |
NewerOlder