Menu
  • HOME
  • TAGS

Why is there no “non-empty list” type in the Haskell base libraries?

list,haskell,types,strong-typing

The list of packages that define such a type is itself rather nonempty: there are at least six of them: NonEmpty NonEmptyList Cardinality non-empty semigroups mono-traversable The Haskell Wiki has a whole page about non-empty lists. Your question: why are non-empty lists not in the base package is more difficult...

In Python, why can I multiply a string by a number, but I can't add a string and a number?

python,strong-typing,typing

Is this just an arbitrary choice to overload * with a definition for a String and Int arg, and to not overload + for a String and Int? In essence, yes. However, it's worth noting that the two operations you're talking about are not really parallel. In 'a' *...

How to declare Module in Page to use IDE autocompletion In GEB?

autocomplete,dsl,geb,strong-typing,pageobjects

Stronger typing for module definitions has been recently added to master but hasn't been released yet. Basically the location of module() method has changed so that now IntelliJ understands the return type of it. If you wish to give it a try then you can use 0.10.1-SNAPSHOT from Geb's snapshot...

Controller in Appdelegate is never released

ios,objective-c,appdelegate,strong-typing

I'm not sure how you're using this reference, but you can make it a weak pointer: @property (nonatomic, weak) MenuViewController *menuViewController; Set the pointer after you have initialized and presented the menuViewController. If you have to initialize the menuViewController first and keep a reference for a later use, then you...

Which is the correct design pattern for navigation?

design-patterns,design,navigation,strong-typing,dynamic-typing

It seems that you can benefit from using the State Pattern. The idea will be that you will have a State for every screen. Each screen will do its own checking to determine where the user would go to next when hitting the appropriate buttons. ...

Why can a list be compared with an integer in Python [duplicate]

python,strong-typing,typing,dynamic-typing

As of Python 3.x, you are correct this is no longer allowed >>> [] < 10 Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> [] < 10 TypeError: unorderable types: list() < int() As for why this worked in Python 2.x, read here...