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
;;; WEB -- 18 June 2016 | |
;; Type inferencer in miniKanren, adapted from Oleg's Kanren polymorphic type inferencer | |
;; | |
;; http://kanren.cvs.sourceforge.net/viewvc/kanren/kanren/examples/type-inference.scm?view=markup | |
;; | |
;; Unlike the Kanren inferencer, this definition of !- is a pure | |
;; relation, with no cuts and no uses of project. This inferencer | |
;; also does not require a parser/unparser, and allows shadowing. |
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
float r = sample.r; | |
float g = sample.g; | |
float b = sample.b; | |
float median = max(min(r, g), min(max(r, g), b)); | |
float signed_dist = median - 0.5; | |
float d = fwidth(signed_dist); | |
float opacity = smoothstep(-d, d, signed_dist); | |
//apply opacity to final alpha | |
color.a *= opacity; |
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
{-# OPTIONS_HADDOCK ignore-exports #-} | |
module DirTree where | |
import Control.Applicative | |
import Control.Exception.Base(IOException) | |
import Data.Ord (comparing) | |
import Data.List (sort, sortBy, (\\)) | |
import Data.Time.Clock | |
import Data.Word |