Talk:Weird numbers: Difference between revisions
Content added Content deleted
(→A faster and less ambitious algorithm ?: Updated sample function) |
|||
Line 20: | Line 20: | ||
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:52, 24 March 2019 (UTC) |
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:52, 24 March 2019 (UTC) |
||
: PS I think we may be able to see and test the operation of '''hasSum''' more clearly if we enrich its type from Bool to [Int] (with a return value of the empty list for '''False''', and the integers of the first sum found for '''True'''. Let's call this richer-typed variant '''anySum''', and sketch it in Python 3. |
: PS I think we may be able to see and test the operation of '''hasSum''' more clearly if we enrich its type from Bool to [Int] (with a return value of the empty list for '''False''', and the integers of the first sum found for '''True'''). Let's call this richer-typed variant '''anySum''', and sketch it in Python 3. |
||
::<lang python># anySum :: Int -> [Int] -> [Int] |
::<lang python># anySum :: Int -> [Int] -> [Int] |