Jump to content

Talk:Practical numbers: Difference between revisions

Line 1:
 
 
==One of many examples of using Haskell in Python.==
The following are excerpts from Houts Haskell and Python entries on [[Padovan n-step number sequences]] . Hout states that it is ''not'' Haskell typing and yet the valid Haskell type information ''is copied verbatim'' in the Python. It may have another name but he uses that
to hide that hie is deliberately obscuring Python by ignoring tits typing and substituting Haskell typing in examples.
 
Python has its own syntax for typing and its own syntax for typing in comments that is being deliberaterly ignored in by Hout who instead inserts abnother languages typing in Python examples. This is highly un-idiomatic, Python programmers learn would need Haskell knowledge to read this Python example, are highly unlikely to see this in idiomatic Python programs.
 
;Haskell:
<pre>
padovans :: Int -> [Int]
padovans n ...
 
recurrence :: Int -> [Int] -> Maybe (Int, [Int])
recurrence n = ...
 
main :: IO ()
main = ...
...
</pre>
 
;Python:
<pre>
# nStepPadovan :: Int -> [Int]
def nStepPadovan(n): ...
 
# recurrence :: Int -> [Int] -> Int
def recurrence(n): ...
 
# main :: IO ()
def main(): ...
...
</pre>
 
Hout wants to pass-off a Haskell like style of programming that was rejected by the Python community when put to members of the steering committee, as idiomatic Python. Hout wants to hide the Haskell style used and present his code as idiomatic Python when it is not.
 
--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 20:16, 1 April 2021 (UTC)
 
== Haskell type hints are not valid Python==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.