Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If one is able to write a tool to write your program for you, could it be the case that the language lacks syntactic constructs to be terse enough to be pragmatic?


Where is this comment coming from? That is, how much have you looked at what the tool does/written Haskell in the past?

I think the key thing is that sometimes there are multiple ways to answer something. For example consider this type:

  [Maybe a] -> [a]
It takes a list of optional values and returns non-optional values. The ‘obvious’ semantics in Haskell could be achieved with:

  f [] = []
  f (Nothing:xs) = f xs
  f (Just x:xs) = x:f xs
And there are plenty of other ways to write that function. But you could also write functions like

  g xs = []
  h xs = reverse (f xs)
  j [Just a, Just b] = [b, a, b]
  j _ = []
And all three would satisfy the type above. So the type may be a sufficient input to the tool as the programmer may select the suggestion, but it wouldn’t be sufficient input to the compiler as the compiler could just guess the wrong thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: