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 Data.Tuple (swap) | |
ascending_sub_list :: Ord e => [e] -> [[e]] | |
ascending_sub_list [] = [] | |
ascending_sub_list list = ascending_sub_list_first_result : ascending_sub_list rest | |
where (ascending_sub_list_first_result, rest) = ascending_sub_list_first list | |
-- first ascending sub list and the rest | |
ascending_sub_list_first :: Ord e => [e] -> ([e], [e]) | |
ascending_sub_list_first [] = ([], []) |
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
ascending_sub_list :: Ord element => [element] -> [[element]] | |
ascending_sub_list = foldr append [] | |
where | |
append :: Ord element => element -> [[element]] -> [[element]] | |
append element_new sub_list_list | |
| sub_list_list_head : sub_list_list_tail <- sub_list_list, | |
element_new <= head sub_list_list_head | |
= (element_new : sub_list_list_head) : sub_list_list_tail | |
| otherwise = [element_new] : sub_list_list |
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 Prelude hiding (lex) | |
import Data.Char | |
import Data.Maybe | |
import Data.Semigroup | |
{- Vorlesung "Programmierung und Modellierung" | |
LMU München, Sommersemester 2019 | |
Steffen Jost | |
Code zu Folien 7.23ff |
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
newtype Box phantom = Box Bool | |
unbox :: Box phantom -> Bool | |
unbox (Box content) = content | |
myBox :: Show phantom => Box phantom | |
myBox = Box False | |
result :: Bool | |
result = unbox myBox |
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
(defvar haskell-indentation-mode-map | |
(let ((map (make-sparse-keymap))) | |
(define-key map (kbd "RET") #'haskell-indentation-newline-and-indent) | |
(define-key map (kbd "<backtab>") #'haskell-indentation-indent-backwards) | |
(define-key map (kbd ",") #'haskell-indentation-common-electric-command) | |
(define-key map (kbd ";") #'haskell-indentation-common-electric-command) | |
(define-key map (kbd ")") #'haskell-indentation-common-electric-command) | |
(define-key map (kbd "}") #'haskell-indentation-common-electric-command) | |
(define-key map (kbd "]") #'haskell-indentation-common-electric-command) | |
map) |
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
(global-set-key (kbd "<backtab>") 'indent-for-tab-command) | |
(add-hook 'haskell-indentation-mode-hook | |
(lambda () | |
(define-key haskell-indentation-mode-map (kbd "<backtab>") 'indent-for-tab-command))) |
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 NamedFieldPuns #-} | |
import XMonad | |
import XMonad.Config.Desktop | |
import qualified Data.Map as Map | |
main :: IO () | |
main = | |
xmonad $ desktopConfig { | |
terminal = "konsole", |
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 UndecidableInstances #-} | |
{-# language FunctionalDependencies #-} | |
{-# language MultiParamTypeClasses #-} | |
{-# language DataKinds #-} | |
{-# language FlexibleInstances #-} | |
{-# language ExistentialQuantification #-} | |
{-# language PolyKinds #-} | |
{-# language TypeOperators #-} | |
module Main where |
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 FlexibleInstances #-} | |
{-# language UndecidableInstances #-} | |
{-# language TemplateHaskell #-} | |
{-# language DataKinds #-} | |
{-# language OverloadedLabels #-} | |
{-# language MultiParamTypeClasses #-} | |
{-# language GADTs #-} | |
module Main where |
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 BangPatterns #-} | |
module Main where | |
import Debug.Trace (trace) | |
data Source = Source Char Bool | |
data Intermediate = Intermediate !Char !Bool | |
data Destination = Destination Char Bool |
OlderNewer