Defining Reasoning and Heuristics: Human reasoning is commonly defined as the conscious mental process of drawing conclusions or inferences from premises or evidence. It implies deliberation and logical evaluation aimed at reaching a truth or decision. In contrast, heuristics are often described as mental shortcuts or “rules of thumb” that simplify problem-solving. In cognitive psychology, a heuristic is “a process of intuitive judgment, operating under uncertainty, that rapidly produces a generally adequate, though not ideal or optimal, solution” (Heuristic | Definition, Examples, Daniel Kahneman, Amos Tversky, & Facts | Britannica). Heuristics provide quick, effort-minimal answers by exploiting prior knowledge and patterns, at the cost of occasionally leading to biase
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
So, let’s flip a coin: if it’s heads, play a drum, if it’s tails, play a cymbal. Easy. We can emulate a coin flip with our one_in function (introduced in the section on randomness) specifying a probability of 1 in 2: one_in(2). We can then use the result of this to decide between two pieces of code, the code to play the drum and the code to play the cymbal: | |
loop do | |
if one_in(2) | |
sample :drum_heavy_kick | |
else | |
sample :drum_cymbal_closed | |
end | |
Layer 3 Communications is a professional services organization and network systems integrator. We use Haskell to build network security applications that revolve around either analyzing network data or configuring networks.
Networking knowledge can be learned on the job, and thus is not required.
Our stack:
- Backend: Haskell
- Frontend: Small amounts of JavaScript
- Database: Postgres
- Riff on https://www.reddit.com/r/haskell/comments/8qn0wr/safe_api_design_with_ghosts_of_departed_proofs/
- reddit thread: https://www.reddit.com/r/haskell/comments/dlzc46/ghosts_via_departed_proofs_experimenting/
Ghosts of Departed Proofs introduces sortBy
. It sorts using a comparison function a -> a -> Ordering
named "comp
". The name is then recorded in the return type: "this list is sorted by comp
"!
type Cmp :: Type -> Type
type Cmp a = (a -> a -> Ordering)
sortBy :: Cmp a~~comp -> [a] -> SortedBy comp [a]
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 Control.Applicative | |
import Text.ParserCombinators.ReadP | |
data WindInfo = WindInfo | |
{ dir :: Int | |
, speed :: Int | |
, gusts :: Maybe Int | |
} | |
deriving Show |
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 DataKinds #-} | |
{-# LANGUAGE DeriveAnyClass #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE TemplateHaskell #-} |
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: haskell | |
dist: trusty | |
cache: | |
directories: | |
- $HOME/.cabal/packages | |
- $HOME/.cabal/store | |
- $HOME/.stack | |
- $TRAVIS_BUILD_DIR/.stack-work |
Article topics:
NewerOlder