User Tools

Site Tools


codesnippets:compositionoperator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
codesnippets:compositionoperator [2021/04/07 16:52] – created f2b216codesnippets:compositionoperator [2025/10/08 00:48] (current) – external edit 127.0.0.1
Line 17: Line 17:
 f1 ch = toInteger $ Ch.ord(ch) f1 ch = toInteger $ Ch.ord(ch)
  
-f2 :: Integer -> (Integer, Double) +f2 :: Integer -> Double 
-f2 n = (n, fromIntegral n :: Double)+f2 n = fromIntegral n :: Double
  
-f3 :: Char -> (Integer, Double)+f3 :: Char -> Double
 f3 = f2 . f1 f3 = f2 . f1
  
-f4 :: Char -> (Integer, Double) +f4 :: Char -> Double 
-f4 ch = f2 (f1 ch)+f4 ch = f2 (f1 ch)</code> 
 +    * executes with output:<code> 
 +97.0 
 +97.0
 </code> </code>
 +
 +
 +===== ✎ =====
 +~~DISCUSSION~~
codesnippets/compositionoperator.1617807148.txt.gz · Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki