A common statement about monads is that they make pure programming with side effects possible - so let us look at a first example of functions that allow to have debugging informations.
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
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> | |
<opml version="1.0"> | |
<head> | |
<title>PodcastAddict registration feeds</title> | |
<dateCreated>24 Mar 2020 23:51:56</dateCreated> | |
<dateModified>24 Mar 2020 23:51:56</dateModified> | |
</head> | |
<body> | |
<outline text="+1 Forward" type="rss" xmlUrl="http://1forward.libsyn.com/rss" htmlUrl="http://plusoneforward.libsyn.com/podcast" /> | |
<!-- <outline text="13 Minutes to the Moon" type="rss" xmlUrl="https://podcasts.files.bbci.co.uk/w13xttx2.rss" htmlUrl="http://www.bbc.co.uk/programmes/w13xttx2" /> --> |
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
<schedule> | |
<version>1.0</version> | |
<conference> | |
<title>Vienna Honey Swing 2018</title> | |
<acronym>vhs18</acronym> | |
<days>4</days> | |
<start>2018-09-13</start> | |
<end>2018-09-16</end> | |
<timeslot_duration>0:05</timeslot_duration> | |
</conference> |
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
listWidget :: MonadWidget t m => m () | |
listWidget = do | |
rec oldlist :: Dynamic t [Event t Int] | |
<- simpleList newlist ((sample . current) >=> button') | |
clicked :: Event t Int <- leftmost <$> (sample $ current oldlist) | |
newlist :: Dynamic t [Int] <- holdDyn [0..10] ((enumFromTo 0 . succ) <$> clicked) | |
val :: Dynamic t Int <- (holdDyn 0 clicked) | |
divClass "container" $ (dynText $ fmap (("Last clicked value: " <>) . pack . show) val) | |
return () |
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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecursiveDo #-} | |
import Reflex | |
import Reflex.Dom | |
import Data.Monoid ((<>)) | |
import qualified Data.Map as Map | |
import Safe (readMay) | |
import Data.Text (pack, unpack, Text) | |
import Control.Applicative ((<*>), (<$>)) |
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
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE ViewPatterns #-} | |
{-# LANGUAGE BangPatterns #-} | |
import Control.Monad | |
import Control.Monad.Random |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Turtle | |
import Prelude hiding (FilePath) | |
import Data.Either (rights) | |
import qualified Control.Foldl as F | |
import qualified Data.Text as T | |
import Data.Text() |
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
function haskell_info() { | |
cabal_files=(*.cabal(N)) | |
if [ $#cabal_files -gt 0 ]; then | |
if [ -f cabal.sandbox.config ]; then | |
cabal_sandbox_info | |
elif [ -f stack.yaml ]; then | |
stack_info | |
else | |
echo "%{$fg[red]%}no stack/sandbox%{$reset_color%}" | |
fi |
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
% Author: Martin Heuschober | |
% License: CC-BY-4.0 | |
% see https://creativecommons.org/licenses/by/4.0/ | |
\documentclass{article} | |
\usepackage[paperwidth=55cm | |
,paperheight=45cm | |
,left=1cm | |
,right=1cm | |
,top=1cm |
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
% use with > pdflatex --jobname=games-p1 games.tex | |
\documentclass{article} | |
\usepackage{graphics} | |
\usepackage{amsfonts,amssymb,amsmath} | |
\usepackage{tikz} | |
\usetikzlibrary{positioning} | |
\pgfrealjobname{games} | |
\begin{document} | |
\beginpgfgraphicnamed{games-p1} |
NewerOlder